mirror of
https://github.com/grafana/grafana.git
synced 2024-12-29 10:21:41 -06:00
d0e7765c6a
* Annotation: Optionally allow longer annotation tags * Do not accept configuration lower than today's default (500) * Apply suggestion from code review
28 lines
855 B
Go
28 lines
855 B
Go
package annotations
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
"github.com/grafana/grafana/pkg/util/errutil"
|
|
)
|
|
|
|
var (
|
|
ErrTimerangeMissing = errors.New("missing timerange")
|
|
ErrBaseTagLimitExceeded = errutil.NewBase(errutil.StatusBadRequest, "annotations.tag-limit-exceeded", errutil.WithPublicMessage("Tags length exceeds the maximum allowed."))
|
|
)
|
|
|
|
type Repository interface {
|
|
Save(ctx context.Context, item *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)
|
|
}
|
|
|
|
// Cleaner is responsible for cleaning up old annotations
|
|
type Cleaner interface {
|
|
Run(ctx context.Context, cfg *setting.Cfg) (int64, int64, error)
|
|
}
|