Documentation
¶
Index ¶
Constants ¶
View Source
const (
RulesetPutEvent = "PUT"
)
List of possible events executed against a ruleset.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrNotModified = errors.New("not modified") ErrInvalidContinueToken = errors.New("invalid continue token") )
Common errors.
Functions ¶
func IsValidationError ¶
IsValidationError indicates if the given error is a ValidationError pointer.
Types ¶
type RulesetEntries ¶
type RulesetEntries struct {
Entries []RulesetEntry
Revision string // revision when the request was applied
Continue string // token of the next page, if any
}
RulesetEntries holds a list of ruleset entries.
type RulesetEntry ¶
RulesetEntry holds a ruleset and its metadata.
type RulesetEvent ¶
RulesetEvent describes an event that occured on a ruleset.
type RulesetEvents ¶
type RulesetEvents struct {
Events []RulesetEvent
Revision string
}
RulesetEvents holds a list of events occured on a group of rulesets.
type RulesetService ¶
type RulesetService interface {
// List returns all the rulesets entries under the given prefix.
List(ctx context.Context, prefix string, limit int, continueToken string) (*RulesetEntries, error)
// Latest returns the latest version of the ruleset entry which corresponds to the given path.
Latest(ctx context.Context, path string) (*RulesetEntry, error)
// OneByVersion returns the ruleset entry which corresponds to the given path at the given version.
OneByVersion(ctx context.Context, path, version string) (*RulesetEntry, error)
// Watch a prefix for changes and return a list of events.
Watch(ctx context.Context, prefix string, revision string) (*RulesetEvents, error)
// Put is used to store a ruleset version.
Put(ctx context.Context, path string, ruleset *regula.Ruleset) (*RulesetEntry, error)
// Eval evaluates a ruleset given a path and a set of parameters. It implements the regula.Evaluator interface.
Eval(ctx context.Context, path 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.
EvalVersion(ctx context.Context, path, version string, params rule.Params) (*regula.EvalResult, error)
}
RulesetService manages rulesets.
type ValidationError ¶
ValidationError gives informations about the reason of failed validation.
func (*ValidationError) Error ¶
func (v *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.