Documentation ¶
Index ¶
- type GenericRecordedQuery
- type RuleStore
- func (f *RuleStore) Count(ctx context.Context, orgID int64) (int64, error)
- func (f *RuleStore) CountInFolder(ctx context.Context, orgID int64, folderUID string, u *user.SignedInUser) (int64, error)
- func (f *RuleStore) DeleteAlertRulesByUID(_ context.Context, orgID int64, UIDs ...string) error
- func (f *RuleStore) GetAlertRuleByUID(_ context.Context, q *models.GetAlertRuleByUIDQuery) (*models.AlertRule, error)
- func (f *RuleStore) GetAlertRulesGroupByRuleUID(_ context.Context, q *models.GetAlertRulesGroupByRuleUIDQuery) ([]*models.AlertRule, error)
- func (f *RuleStore) GetNamespaceByTitle(_ context.Context, title string, orgID int64, _ *user.SignedInUser) (*folder.Folder, error)
- func (f *RuleStore) GetNamespaceByUID(_ context.Context, uid string, orgID int64, _ *user.SignedInUser) (*folder.Folder, error)
- func (f *RuleStore) GetRecordedCommands(predicate func(cmd interface{}) (interface{}, bool)) []interface{}
- func (f *RuleStore) GetRuleGroupInterval(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string) (int64, error)
- func (f *RuleStore) GetUserVisibleNamespaces(_ context.Context, orgID int64, _ *user.SignedInUser) (map[string]*folder.Folder, error)
- func (f *RuleStore) InTransaction(ctx context.Context, fn func(c context.Context) error) error
- func (f *RuleStore) IncreaseVersionForAllRulesInNamespace(_ context.Context, orgID int64, namespaceUID string) ([]models.AlertRuleKeyWithVersionAndPauseStatus, error)
- func (f *RuleStore) InsertAlertRules(_ context.Context, q []models.AlertRule) (map[string]int64, error)
- func (f *RuleStore) ListAlertRules(_ context.Context, q *models.ListAlertRulesQuery) (models.RulesGroup, error)
- func (f *RuleStore) PutRule(_ context.Context, rules ...*models.AlertRule)
- func (f *RuleStore) UpdateAlertRules(_ context.Context, q []models.UpdateRule) error
- func (f *RuleStore) UpdateRuleGroup(ctx context.Context, orgID int64, namespaceUID string, ruleGroup string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenericRecordedQuery ¶
type GenericRecordedQuery struct { Name string Params []interface{} }
type RuleStore ¶
type RuleStore struct { // OrgID -> RuleGroup -> Namespace -> Rules Rules map[int64][]*models.AlertRule Hook func(cmd interface{}) error // use Hook if you need to intercept some query and return an error RecordedOps []interface{} Folders map[int64][]*folder.Folder // contains filtered or unexported fields }
FakeRuleStore mocks the RuleStore of the scheduler.
func NewRuleStore ¶
func (*RuleStore) CountInFolder ¶
func (*RuleStore) DeleteAlertRulesByUID ¶
func (*RuleStore) GetAlertRuleByUID ¶
func (*RuleStore) GetAlertRulesGroupByRuleUID ¶
func (*RuleStore) GetNamespaceByTitle ¶
func (*RuleStore) GetNamespaceByUID ¶
func (*RuleStore) GetRecordedCommands ¶
func (f *RuleStore) GetRecordedCommands(predicate func(cmd interface{}) (interface{}, bool)) []interface{}
GetRecordedCommands filters recorded commands using predicate function. Returns the subset of the recorded commands that meet the predicate
func (*RuleStore) GetRuleGroupInterval ¶
func (*RuleStore) GetUserVisibleNamespaces ¶
func (*RuleStore) InTransaction ¶
func (*RuleStore) IncreaseVersionForAllRulesInNamespace ¶
func (*RuleStore) InsertAlertRules ¶
func (*RuleStore) ListAlertRules ¶
func (f *RuleStore) ListAlertRules(_ context.Context, q *models.ListAlertRulesQuery) (models.RulesGroup, error)
func (*RuleStore) PutRule ¶
PutRule puts the rule in the Rules map. If there are existing rule in the same namespace, they will be overwritten
func (*RuleStore) UpdateAlertRules ¶
Click to show internal directories.
Click to hide internal directories.