Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBulkNotSupported is returned when unsupported bulk operations are attempted. ErrBulkNotSupported = fmt.Errorf("bulk operations not supported") )
Functions ¶
This section is empty.
Types ¶
type InvalidRuleError ¶
type InvalidRuleError struct{}
InvalidRuleError occurs when a rule is not valid
type JSONMarshalError ¶
type JSONMarshalError struct {
Message string
}
JSONMarshalError describes a JSON marshal or unmarshaling error
type K8S ¶ added in v1.0.0
type K8S struct {
// contains filtered or unexported fields
}
K8S controller. Currently no bulk insert/update operations are supported and the controller is bound to a single namespace.
func (*K8S) AddRules ¶ added in v1.0.0
AddRules validates the rules and adds them to the collection for the namespace.
func (*K8S) DeleteRules ¶ added in v1.0.0
func (k8s *K8S) DeleteRules(_ string, f api.RuleFilter) (err error)
DeleteRules deletes rules that match the filter in the namespace. FIXME: retrieve, filter and delete are not atomic.
func (*K8S) GetRules ¶ added in v1.0.0
func (k8s *K8S) GetRules(_ string, f api.RuleFilter) (RetrievedRules, error)
GetRules returns a collection of filtered rules from the namespace.
type Manager ¶
type Manager interface { // AddRules validates the rules and adds them to the collection for the namespace. AddRules(namespace string, rules []api.Rule) (NewRules, error) // GetRules returns a collection of filtered rules from the namespace. GetRules(namespace string, filter api.RuleFilter) (RetrievedRules, error) // UpdateRules updates rules by ID in the namespace. UpdateRules(namespace string, rules []api.Rule) error // DeleteRules deletes rules that match the filter in the namespace. DeleteRules(namespace string, filter api.RuleFilter) error }
Manager is an interface for managing collections of rules mapped by namespace.
func NewMemoryManager ¶
NewMemoryManager constructs a new in memory manager.
type NewRules ¶
type NewRules struct { // IDs of the added rules. IDs []string }
NewRules provides information about newly added rules.
type RedisInsertError ¶
type RedisInsertError struct{}
RedisInsertError occurs when there is an issue writing to Redis
type RetrievedRules ¶
type RetrievedRules struct { // Rules that passed the filter. Rules []api.Rule // Revision of the rules for this namespace. Each time the collection of rules for the namespace are changed // the revision is incremented. Revision int64 }
RetrievedRules are the results of a read from a manager.