etcd

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RulesetService

type RulesetService struct {
	Client    *clientv3.Client
	Logger    zerolog.Logger
	Namespace string
}

RulesetService manages the rulesets using etcd.

func (*RulesetService) Eval

func (s *RulesetService) Eval(ctx context.Context, path string, params rule.Params) (*regula.EvalResult, error)

Eval evaluates a ruleset given a path and a set of parameters. It implements the regula.Evaluator interface.

func (*RulesetService) EvalVersion

func (s *RulesetService) EvalVersion(ctx context.Context, path, version string, params rule.Params) (*regula.EvalResult, error)

EvalVersion evaluates a ruleset given a path and a set of parameters. It implements the regula.Evaluator interface.

func (*RulesetService) Latest

func (s *RulesetService) Latest(ctx context.Context, path string) (*store.RulesetEntry, error)

Latest returns the latest version of the ruleset entry which corresponds to the given path. It returns store.ErrNotFound if the path doesn't exist or if it's not a ruleset.

func (*RulesetService) List

func (s *RulesetService) List(ctx context.Context, prefix string, limit int, continueToken string) (*store.RulesetEntries, error)

List returns all the rulesets entries under the given prefix.

func (*RulesetService) OneByVersion

func (s *RulesetService) OneByVersion(ctx context.Context, path, version string) (*store.RulesetEntry, error)

OneByVersion returns the ruleset entry which corresponds to the given path at the given version. It returns store.ErrNotFound if the path doesn't exist or if it's not a ruleset.

func (*RulesetService) Put

func (s *RulesetService) Put(ctx context.Context, path string, ruleset *regula.Ruleset) (*store.RulesetEntry, error)

Put adds a version of the given ruleset using an uuid.

func (*RulesetService) Watch

func (s *RulesetService) Watch(ctx context.Context, prefix string, revision string) (*store.RulesetEvents, error)

Watch the given prefix for anything new.

Jump to

Keyboard shortcuts

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