Documentation ¶
Index ¶
- type RulesetService
- func (s *RulesetService) Eval(ctx context.Context, path string, params rule.Params) (*regula.EvalResult, error)
- func (s *RulesetService) EvalVersion(ctx context.Context, path, version string, params rule.Params) (*regula.EvalResult, error)
- func (s *RulesetService) Latest(ctx context.Context, path string) (*store.RulesetEntry, error)
- func (s *RulesetService) List(ctx context.Context, prefix string, limit int, continueToken string) (*store.RulesetEntries, error)
- func (s *RulesetService) OneByVersion(ctx context.Context, path, version string) (*store.RulesetEntry, error)
- func (s *RulesetService) Put(ctx context.Context, path string, ruleset *regula.Ruleset) (*store.RulesetEntry, error)
- func (s *RulesetService) Watch(ctx context.Context, prefix string, revision string) (*store.RulesetEvents, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RulesetService ¶
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.