local

package
v0.0.0-...-cae4bf4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

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) (*Client, error)

func (*Client) DeleteRuleGroup

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

DeleteRuleGroup implements RuleStore

func (*Client) GetRuleGroup

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

GetRuleGroup implements RuleStore

func (*Client) ListAllRuleGroups

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

ListAllRuleGroups implements RuleStore

func (*Client) ListRuleGroups

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

ListRuleGroups implements RuleStore

func (*Client) SetRuleGroup

func (l *Client) SetRuleGroup(ctx context.Context, userID, namespace string, group *rules.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