Documentation
¶
Overview ¶
Package matcher is a generated GoMock package.
Index ¶
- type Configuration
- func (cfg *Configuration) NewMatcher(cache cache.Cache, kvCluster client.Client, clockOpts clock.Options, ...) (Matcher, error)
- func (cfg *Configuration) NewNamespaces(kvCluster client.Client, clockOpts clock.Options, ...) (Namespaces, error)
- func (cfg *Configuration) NewOptions(kvCluster client.Client, clockOpts clock.Options, ...) (Options, error)
- type Matcher
- type MockMatcher
- func (m *MockMatcher) Close() error
- func (m *MockMatcher) EXPECT() *MockMatcherMockRecorder
- func (m *MockMatcher) ForwardMatch(arg0 id.ID, arg1, arg2 int64, arg3 rules.MatchOptions) (rules.MatchResult, error)
- func (m *MockMatcher) LatestRollupRules(arg0 []byte, arg1 int64) ([]view.RollupRule, error)
- type MockMatcherMockRecorder
- type Namespaces
- type OnNamespaceAddedFn
- type OnNamespaceRemovedFn
- type OnRuleSetUpdatedFn
- type Options
- type RuleSet
- type RuleSetKeyFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
InitWatchTimeout time.Duration `yaml:"initWatchTimeout"`
RulesKVConfig kv.OverrideConfiguration `yaml:"rulesKVConfig"`
NamespacesKey string `yaml:"namespacesKey" validate:"nonzero"`
RuleSetKeyFmt string `yaml:"ruleSetKeyFmt" validate:"nonzero"`
NamespaceTag string `yaml:"namespaceTag" validate:"nonzero"`
DefaultNamespace string `yaml:"defaultNamespace" validate:"nonzero"`
NameTagKey string `yaml:"nameTagKey" validate:"nonzero"`
MatchRangePast *time.Duration `yaml:"matchRangePast"`
SortedTagIteratorPool pool.ObjectPoolConfiguration `yaml:"sortedTagIteratorPool"`
}
Configuration is config used to create a Matcher.
func (*Configuration) NewMatcher ¶
func (cfg *Configuration) NewMatcher( cache cache.Cache, kvCluster client.Client, clockOpts clock.Options, instrumentOpts instrument.Options, ) (Matcher, error)
NewMatcher creates a Matcher.
func (*Configuration) NewNamespaces ¶
func (cfg *Configuration) NewNamespaces( kvCluster client.Client, clockOpts clock.Options, instrumentOpts instrument.Options, ) (Namespaces, error)
NewNamespaces creates a matcher.Namespaces.
func (*Configuration) NewOptions ¶
func (cfg *Configuration) NewOptions( kvCluster client.Client, clockOpts clock.Options, instrumentOpts instrument.Options, ) (Options, error)
NewOptions creates a Options.
type MockMatcher ¶
type MockMatcher struct {
// contains filtered or unexported fields
}
MockMatcher is a mock of Matcher interface.
func NewMockMatcher ¶
func NewMockMatcher(ctrl *gomock.Controller) *MockMatcher
NewMockMatcher creates a new mock instance.
func (*MockMatcher) EXPECT ¶
func (m *MockMatcher) EXPECT() *MockMatcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMatcher) ForwardMatch ¶
func (m *MockMatcher) ForwardMatch(arg0 id.ID, arg1, arg2 int64, arg3 rules.MatchOptions) (rules.MatchResult, error)
ForwardMatch mocks base method.
func (*MockMatcher) LatestRollupRules ¶ added in v1.4.2
func (m *MockMatcher) LatestRollupRules(arg0 []byte, arg1 int64) ([]view.RollupRule, error)
LatestRollupRules mocks base method.
type MockMatcherMockRecorder ¶
type MockMatcherMockRecorder struct {
// contains filtered or unexported fields
}
MockMatcherMockRecorder is the mock recorder for MockMatcher.
func (*MockMatcherMockRecorder) Close ¶
func (mr *MockMatcherMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockMatcherMockRecorder) ForwardMatch ¶
func (mr *MockMatcherMockRecorder) ForwardMatch(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
ForwardMatch indicates an expected call of ForwardMatch.
func (*MockMatcherMockRecorder) LatestRollupRules ¶ added in v1.4.2
func (mr *MockMatcherMockRecorder) LatestRollupRules(arg0, arg1 interface{}) *gomock.Call
LatestRollupRules indicates an expected call of LatestRollupRules.
type Namespaces ¶
type Namespaces interface {
rules.ActiveSet
// Open opens the namespaces and starts watching runtime rule updates
Open() error
// Version returns the current version for a given namespace.
Version(namespace []byte) int
// Close closes the namespaces.
Close()
}
Namespaces manages runtime updates to registered namespaces and provides API to match metic ids against rules in the corresponding namespaces.
func NewNamespaces ¶
func NewNamespaces(key string, opts Options) Namespaces
NewNamespaces creates a new namespaces object.
type OnNamespaceAddedFn ¶
OnNamespaceAddedFn is called when a namespace is added.
type OnNamespaceRemovedFn ¶
type OnNamespaceRemovedFn func(namespace []byte)
OnNamespaceRemovedFn is called when a namespace is removed.
type OnRuleSetUpdatedFn ¶
OnRuleSetUpdatedFn is called when a ruleset is updated.
type Options ¶
type Options interface {
// SetClockOptions sets the clock options.
SetClockOptions(value clock.Options) Options
// ClockOptions returns the clock options.
ClockOptions() clock.Options
// SetInstrumentOptions sets the instrument options.
SetInstrumentOptions(value instrument.Options) Options
// InstrumentOptions returns the instrument options.
InstrumentOptions() instrument.Options
// SetRuleSetOptions sets the ruleset options.
SetRuleSetOptions(value rules.Options) Options
// RuleSetOptions returns the ruleset options.
RuleSetOptions() rules.Options
// SetInitWatchTimeout sets the initial watch timeout.
SetInitWatchTimeout(value time.Duration) Options
// InitWatchTimeout returns the initial watch timeout.
InitWatchTimeout() time.Duration
// SetKVStore sets the kv store.
SetKVStore(value kv.Store) Options
// KVStore returns the kv store.
KVStore() kv.Store
// SetNamespacesKey sets the key for the full list of namespaces.
SetNamespacesKey(value string) Options
// NamespacesKey returns the key for the full list of namespaces.
NamespacesKey() string
// SetRuleSetKeyFn sets the function to generate ruleset keys.
SetRuleSetKeyFn(value RuleSetKeyFn) Options
// RuleSetKeyFn returns the function to generate ruleset keys.
RuleSetKeyFn() RuleSetKeyFn
// SetNamespaceResolver sets the NamespaceResolver.
SetNamespaceResolver(value namespace.Resolver) Options
// NamespaceResolver returns the namespace Resolver.
NamespaceResolver() namespace.Resolver
// SetMatchRangePast sets the limit on the earliest time eligible for rule matching.
SetMatchRangePast(value time.Duration) Options
// MatchRangePast returns the limit on the earliest time eligible for rule matching.
MatchRangePast() time.Duration
// SetOnNamespaceAddedFn sets the function to be called when a namespace is added.
SetOnNamespaceAddedFn(value OnNamespaceAddedFn) Options
// OnNamespaceAddedFn returns the function to be called when a namespace is added.
OnNamespaceAddedFn() OnNamespaceAddedFn
// SetOnNamespaceRemovedFn sets the function to be called when a namespace is removed.
SetOnNamespaceRemovedFn(value OnNamespaceRemovedFn) Options
// OnNamespaceRemovedFn returns the function to be called when a namespace is removed.
OnNamespaceRemovedFn() OnNamespaceRemovedFn
// SetOnRuleSetUpdatedFn sets the function to be called when a ruleset is updated.
SetOnRuleSetUpdatedFn(value OnRuleSetUpdatedFn) Options
// OnRuleSetUpdatedFn returns the function to be called when a ruleset is updated.
OnRuleSetUpdatedFn() OnRuleSetUpdatedFn
// SetRequireNamespaceWatchOnInit sets the flag to ensure matcher is initialized with a loaded namespace watch.
SetRequireNamespaceWatchOnInit(value bool) Options
// RequireNamespaceWatchOnInit returns the flag to ensure matcher is initialized with a loaded namespace watch.
RequireNamespaceWatchOnInit() bool
// InterruptedCh returns the interrupted channel.
InterruptedCh() <-chan struct{}
// SetInterruptedCh sets the interrupted channel.
SetInterruptedCh(value <-chan struct{}) Options
}
Options provide a set of options for the matcher.
type RuleSet ¶
type RuleSet interface {
runtime.Value
rules.ActiveSet
// Namespace returns the namespace of the ruleset.
Namespace() []byte
// Version returns the current version of the ruleset.
Version() int
// CutoverNanos returns the cutover time of the ruleset.
CutoverNanos() int64
// Tombstoned returns whether the ruleset is tombstoned.
Tombstoned() bool
}
RuleSet manages runtime updates to registered rules and provides API to match metic ids against rules in the corresponding ruleset.
type RuleSetKeyFn ¶
RuleSetKeyFn generates the ruleset key for a given namespace.