Documentation ¶
Index ¶
- func NewXormStore(cfg *setting.Cfg, l log.Logger, db db.DB, tagService tag.Service) *xormRepositoryImpl
- type CleanupServiceImpl
- type CompositeStore
- type RepositoryImpl
- func (r *RepositoryImpl) Delete(ctx context.Context, params *annotations.DeleteParams) error
- func (r *RepositoryImpl) Find(ctx context.Context, query *annotations.ItemQuery) ([]*annotations.ItemDTO, error)
- func (r *RepositoryImpl) FindTags(ctx context.Context, query *annotations.TagsQuery) (annotations.FindTagsResult, error)
- func (r *RepositoryImpl) Save(ctx context.Context, item *annotations.Item) error
- func (r *RepositoryImpl) SaveMany(ctx context.Context, items []annotations.Item) error
- func (r *RepositoryImpl) Update(ctx context.Context, item *annotations.Item) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CleanupServiceImpl ¶
type CleanupServiceImpl struct {
// contains filtered or unexported fields
}
CleanupServiceImpl is responsible for cleaning old annotations.
func ProvideCleanupService ¶
func ProvideCleanupService(db db.DB, cfg *setting.Cfg) *CleanupServiceImpl
func (*CleanupServiceImpl) Run ¶
Run deletes old annotations created by alert rules, API requests and human made in the UI. It subsequently deletes orphaned rows from the annotation_tag table. Cleanup actions are performed in batches so that no query takes too long to complete.
Returns the number of annotation and annotation_tag rows deleted. If an error occurs, it returns the number of rows affected so far.
type CompositeStore ¶
type CompositeStore struct {
// contains filtered or unexported fields
}
CompositeStore is a read store that combines two or more read stores, and queries all stores in parallel.
func NewCompositeStore ¶
func NewCompositeStore(logger log.Logger, readers ...readStore) *CompositeStore
func (*CompositeStore) Get ¶
func (c *CompositeStore) Get(ctx context.Context, query *annotations.ItemQuery, accessResources *accesscontrol.AccessResources) ([]*annotations.ItemDTO, error)
Get returns annotations from all stores, and combines the results.
func (*CompositeStore) GetTags ¶
func (c *CompositeStore) GetTags(ctx context.Context, query *annotations.TagsQuery) (annotations.FindTagsResult, error)
GetTags returns tags from all stores, and combines the results.
func (*CompositeStore) Type ¶
func (c *CompositeStore) Type() string
Satisfy the commonStore interface, in practice this is not used.
type RepositoryImpl ¶
type RepositoryImpl struct {
// contains filtered or unexported fields
}
func ProvideService ¶
func ProvideService( db db.DB, cfg *setting.Cfg, features featuremgmt.FeatureToggles, tagService tag.Service, ) *RepositoryImpl
func (*RepositoryImpl) Delete ¶
func (r *RepositoryImpl) Delete(ctx context.Context, params *annotations.DeleteParams) error
func (*RepositoryImpl) Find ¶
func (r *RepositoryImpl) Find(ctx context.Context, query *annotations.ItemQuery) ([]*annotations.ItemDTO, error)
func (*RepositoryImpl) FindTags ¶
func (r *RepositoryImpl) FindTags(ctx context.Context, query *annotations.TagsQuery) (annotations.FindTagsResult, error)
func (*RepositoryImpl) Save ¶
func (r *RepositoryImpl) Save(ctx context.Context, item *annotations.Item) error
func (*RepositoryImpl) SaveMany ¶
func (r *RepositoryImpl) SaveMany(ctx context.Context, items []annotations.Item) error
SaveMany inserts multiple annotations at once. It does not return IDs associated with created annotations. If you need this functionality, use the single-item Save instead.
func (*RepositoryImpl) Update ¶
func (r *RepositoryImpl) Update(ctx context.Context, item *annotations.Item) error