local

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "local"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client expects to load already existing rules located at:

cfg.Directory / userID / namespace

func NewLocalRulesClient

func NewLocalRulesClient(cfg Config, loader promRules.GroupLoader) (*Client, error)

func (*Client) DeleteNamespace

func (l *Client) DeleteNamespace(ctx context.Context, userID, namespace string) error

DeleteNamespace implements RulerStore

func (*Client) DeleteRuleGroup

func (l *Client) DeleteRuleGroup(ctx context.Context, userID, namespace, group string) error

DeleteRuleGroup implements RuleStore

func (*Client) GetRuleGroup

func (l *Client) GetRuleGroup(ctx context.Context, userID, namespace, group string) (*rulespb.RuleGroupDesc, error)

GetRuleGroup implements RuleStore

func (*Client) ListAllRuleGroups

func (l *Client) ListAllRuleGroups(ctx context.Context) (map[string]rulespb.RuleGroupList, error)

ListAllRuleGroups implements rules.RuleStore. This method also loads the rules.

func (*Client) ListAllUsers

func (l *Client) ListAllUsers(ctx context.Context) ([]string, error)

func (*Client) ListRuleGroupsForUserAndNamespace

func (l *Client) ListRuleGroupsForUserAndNamespace(ctx context.Context, userID, namespace string) (rulespb.RuleGroupList, error)

ListRuleGroupsForUserAndNamespace implements rules.RuleStore. This method also loads the rules.

func (*Client) LoadRuleGroups

func (l *Client) LoadRuleGroups(_ context.Context, _ map[string]rulespb.RuleGroupList) error

func (*Client) SetRuleGroup

func (l *Client) SetRuleGroup(ctx context.Context, userID, namespace string, group *rulespb.RuleGroupDesc) error

SetRuleGroup implements RuleStore

type Config

type Config struct {
	Directory string `yaml:"directory"`
}

func (*Config) RegisterFlagsWithPrefix

func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlags registers flags.

Jump to

Keyboard shortcuts

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