annotationsimpl

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewXormStore

func NewXormStore(cfg *setting.Cfg, l log.Logger, db db.DB, tagService tag.Service) *xormRepositoryImpl

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

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 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

Get returns annotations from all stores, and combines the results.

func (*CompositeStore) GetTags

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 (*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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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