Documentation ¶
Index ¶
- type Config
- type ConfigManager
- type ConfigSource
- type MockConfigManager
- func (_m *MockConfigManager) Deregister(proxyID proxycfg.ProxyID, source proxycfg.ProxySource)
- func (_m *MockConfigManager) Register(proxyID proxycfg.ProxyID, service *structs.NodeService, ...) error
- func (_m *MockConfigManager) Watch(req proxycfg.ProxyID) (<-chan *proxycfg.ConfigSnapshot, proxycfg.CancelFunc)
- type MockWatcher
- type Store
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // NodeName is the name of the local agent node. NodeName string // Manager is the proxycfg Manager with which proxy services will be registered. Manager ConfigManager // State is the agent's local state that will be used to check if a proxy is // registered locally. LocalState *local.State // LocalConfigSource is used to configure proxies registered in the agent's // local state. LocalConfigSource Watcher // GetStore is used to access the server's state store. GetStore func() Store // Logger will be used to write log messages. Logger hclog.Logger }
type ConfigManager ¶
type ConfigManager interface { Watch(req proxycfg.ProxyID) (<-chan *proxycfg.ConfigSnapshot, proxycfg.CancelFunc) Register(proxyID proxycfg.ProxyID, service *structs.NodeService, source proxycfg.ProxySource, token string, overwrite bool) error Deregister(proxyID proxycfg.ProxyID, source proxycfg.ProxySource) }
type ConfigSource ¶
type ConfigSource struct { Config // contains filtered or unexported fields }
ConfigSource wraps a proxycfg.Manager to register services with it, from the catalog, when they are requested by the xDS server.
func NewConfigSource ¶
func NewConfigSource(cfg Config) *ConfigSource
NewConfigSource creates a ConfigSource with the given configuration.
func (*ConfigSource) Shutdown ¶
func (m *ConfigSource) Shutdown()
func (*ConfigSource) Watch ¶
func (m *ConfigSource) Watch(serviceID structs.ServiceID, nodeName string, token string) (<-chan *proxycfg.ConfigSnapshot, proxycfg.CancelFunc, error)
Watch wraps the underlying proxycfg.Manager and dynamically registers services from the catalog with it when requested by the xDS server.
type MockConfigManager ¶
MockConfigManager is an autogenerated mock type for the ConfigManager type
func NewMockConfigManager ¶
func NewMockConfigManager(t testing.TB) *MockConfigManager
NewMockConfigManager creates a new instance of MockConfigManager. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockConfigManager) Deregister ¶
func (_m *MockConfigManager) Deregister(proxyID proxycfg.ProxyID, source proxycfg.ProxySource)
Deregister provides a mock function with given fields: proxyID, source
func (*MockConfigManager) Register ¶
func (_m *MockConfigManager) Register(proxyID proxycfg.ProxyID, service *structs.NodeService, source proxycfg.ProxySource, token string, overwrite bool) error
Register provides a mock function with given fields: proxyID, service, source, token, overwrite
func (*MockConfigManager) Watch ¶
func (_m *MockConfigManager) Watch(req proxycfg.ProxyID) (<-chan *proxycfg.ConfigSnapshot, proxycfg.CancelFunc)
Watch provides a mock function with given fields: req
type MockWatcher ¶
MockWatcher is an autogenerated mock type for the Watcher type
func NewMockWatcher ¶
func NewMockWatcher(t testing.TB) *MockWatcher
NewMockWatcher creates a new instance of MockWatcher. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockWatcher) Watch ¶
func (_m *MockWatcher) Watch(proxyID structs.ServiceID, nodeName string, token string) (<-chan *proxycfg.ConfigSnapshot, proxycfg.CancelFunc, error)
Watch provides a mock function with given fields: proxyID, nodeName, token