/
githubmirror
/
grafana
Обзор
Документация
Войти
/
githubmirror
/
grafana
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
pkg/services/annotations/annotations.go
36 строк
1 KB
Tania
Annotations: Add config instead of relying on settings (#120207)
19 мар 2026, 18:53
Не верифицирован
19 мар 2026, 18:53
a2b5422
Код
Авторство
О чём код?
package annotations import ( "context" "errors" "github.com/grafana/grafana/pkg/apimachinery/errutil" "github.com/grafana/grafana/pkg/setting" ) var ( ErrTimerangeMissing = errors.New("missing timerange") ErrBaseTagLimitExceeded = errutil.BadRequest("annotations.tag-limit-exceeded", errutil.WithPublicMessage("Tags length exceeds the maximum allowed.")) ) //go:generate mockery --name Repository --structname FakeAnnotationsRepo --inpackage --filename annotations_repository_mock.go type Repository interface { Save(ctx context.Context, item *Item) error SaveMany(ctx context.Context, items []Item) error Update(ctx context.Context, item *Item) error Find(ctx context.Context, query *ItemQuery) ([]*ItemDTO, error) Delete(ctx context.Context, params *DeleteParams) error FindTags(ctx context.Context, query *TagsQuery) (FindTagsResult, error) } // CleanupSettings groups pruning policies for each annotation category. type CleanupSettings struct { Alerting setting.AnnotationCleanupSettings API setting.AnnotationCleanupSettings Dashboard setting.AnnotationCleanupSettings } // Cleaner is responsible for cleaning up old annotations type Cleaner interface { Run(ctx context.Context, settings CleanupSettings) (int64, int64, error) }