annotationsimpl

package
v0.0.0-kmdagger1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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, features featuremgmt.FeatureToggles) *CleanupServiceImpl

func (*CleanupServiceImpl) Run

func (cs *CleanupServiceImpl) Run(ctx context.Context, cfg *setting.Cfg) (int64, int64, error)

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 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 (*RepositoryImpl) FindTags

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL