Documentation
¶
Overview ¶
Package routing is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPolicyConfig ¶
type MockPolicyConfig struct {
// contains filtered or unexported fields
}
MockPolicyConfig is a mock of PolicyConfig interface.
func NewMockPolicyConfig ¶
func NewMockPolicyConfig(ctrl *gomock.Controller) *MockPolicyConfig
NewMockPolicyConfig creates a new mock instance.
func (*MockPolicyConfig) EXPECT ¶
func (m *MockPolicyConfig) EXPECT() *MockPolicyConfigMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPolicyConfig) TrafficTypes ¶
func (m *MockPolicyConfig) TrafficTypes() map[string]uint64
TrafficTypes mocks base method.
type MockPolicyConfigMockRecorder ¶
type MockPolicyConfigMockRecorder struct {
// contains filtered or unexported fields
}
MockPolicyConfigMockRecorder is the mock recorder for MockPolicyConfig.
func (*MockPolicyConfigMockRecorder) TrafficTypes ¶
func (mr *MockPolicyConfigMockRecorder) TrafficTypes() *gomock.Call
TrafficTypes indicates an expected call of TrafficTypes.
type MockPolicyHandler ¶
type MockPolicyHandler struct {
// contains filtered or unexported fields
}
MockPolicyHandler is a mock of PolicyHandler interface.
func NewMockPolicyHandler ¶
func NewMockPolicyHandler(ctrl *gomock.Controller) *MockPolicyHandler
NewMockPolicyHandler creates a new mock instance.
func (*MockPolicyHandler) EXPECT ¶
func (m *MockPolicyHandler) EXPECT() *MockPolicyHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPolicyHandler) GetTrafficTypes ¶
func (m *MockPolicyHandler) GetTrafficTypes() map[string]uint64
GetTrafficTypes mocks base method.
func (*MockPolicyHandler) Subscribe ¶
func (m *MockPolicyHandler) Subscribe(arg0 PolicyUpdateListener) int
Subscribe mocks base method.
func (*MockPolicyHandler) Unsubscribe ¶
func (m *MockPolicyHandler) Unsubscribe(arg0 int)
Unsubscribe mocks base method.
type MockPolicyHandlerMockRecorder ¶
type MockPolicyHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockPolicyHandlerMockRecorder is the mock recorder for MockPolicyHandler.
func (*MockPolicyHandlerMockRecorder) Close ¶
func (mr *MockPolicyHandlerMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockPolicyHandlerMockRecorder) GetTrafficTypes ¶
func (mr *MockPolicyHandlerMockRecorder) GetTrafficTypes() *gomock.Call
GetTrafficTypes indicates an expected call of GetTrafficTypes.
func (*MockPolicyHandlerMockRecorder) Subscribe ¶
func (mr *MockPolicyHandlerMockRecorder) Subscribe(arg0 interface{}) *gomock.Call
Subscribe indicates an expected call of Subscribe.
func (*MockPolicyHandlerMockRecorder) Unsubscribe ¶
func (mr *MockPolicyHandlerMockRecorder) Unsubscribe(arg0 interface{}) *gomock.Call
Unsubscribe indicates an expected call of Unsubscribe.
type PolicyConfig ¶
PolicyConfig contains information for how to route metrics to a consumer service.
func NewPolicyConfig ¶
func NewPolicyConfig(trafficTypes map[string]uint64) PolicyConfig
NewPolicyConfig creates a new policy config.
func NewPolicyConfigFromValue ¶
func NewPolicyConfigFromValue(v kv.Value) (PolicyConfig, error)
NewPolicyConfigFromValue creates a new policy from a value, where the value is a protobuf message of RoutingPolicyConfig.
type PolicyHandler ¶
type PolicyHandler interface {
// Close closes the policy watcher.
Close()
// GetTrafficTypes returns the traffic types.
GetTrafficTypes() map[string]uint64
// Subscribe adds a listener that will be called when the policy updates.
// Returns a subscription ID that can be used to unsubscribe.
Subscribe(listener PolicyUpdateListener) int
// Unsubscribe removes a listener by its subscription ID.
Unsubscribe(id int)
}
PolicyHandler handles dynamic routing policy updates from a KV store.
func NewRoutingPolicyHandler ¶
func NewRoutingPolicyHandler(opts PolicyHandlerOptions) (PolicyHandler, error)
NewRoutingPolicyHandler creates a new routing policy handler.
type PolicyHandlerOptions ¶
type PolicyHandlerOptions interface {
WithKVClient(kvClient client.Client) PolicyHandlerOptions
KVClient() client.Client
WithKVOverrideOptions(kvOverrideOptions kv.OverrideOptions) PolicyHandlerOptions
KVOverrideOptions() kv.OverrideOptions
WithKVKey(kvKey string) PolicyHandlerOptions
KVKey() string
Validate() error
}
PolicyHandlerOptions provides options for creating a PolicyHandler.
func NewPolicyHandlerOptions ¶
func NewPolicyHandlerOptions() PolicyHandlerOptions
NewPolicyHandlerOptions creates a new PolicyHandlerOptions.
type PolicyUpdateListener ¶
type PolicyUpdateListener func(PolicyConfig)
PolicyUpdateListener is called when the policy configuration changes.