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 MockSessionLimiter
- type MockWatcher
- type SessionLimiter
- 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
// SessionLimiter is used to enforce xDS concurrency limits.
SessionLimiter SessionLimiter
}
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, limiter.SessionTerminatedChan, 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 mockConstructorTestingTNewMockConfigManager) *MockConfigManager
NewMockConfigManager creates a new instance of MockConfigManager. It also registers a testing 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 MockSessionLimiter ¶
MockSessionLimiter is an autogenerated mock type for the SessionLimiter type
func NewMockSessionLimiter ¶
func NewMockSessionLimiter(t mockConstructorTestingTNewMockSessionLimiter) *MockSessionLimiter
NewMockSessionLimiter creates a new instance of MockSessionLimiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockSessionLimiter) BeginSession ¶
func (_m *MockSessionLimiter) BeginSession() (limiter.Session, error)
BeginSession provides a mock function with given fields:
type MockWatcher ¶
MockWatcher is an autogenerated mock type for the Watcher type
func NewMockWatcher ¶
func NewMockWatcher(t mockConstructorTestingTNewMockWatcher) *MockWatcher
NewMockWatcher creates a new instance of MockWatcher. It also registers a testing 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, limiter.SessionTerminatedChan, proxycfg.CancelFunc, error)
Watch provides a mock function with given fields: proxyID, nodeName, token
type SessionLimiter ¶
type Store ¶
type Store interface {
NodeService(ws memdb.WatchSet, nodeName string, serviceID string, entMeta *acl.EnterpriseMeta, peerName string) (uint64, *structs.NodeService, error)
ReadResolvedServiceConfigEntries(ws memdb.WatchSet, serviceName string, entMeta *acl.EnterpriseMeta, upstreamIDs []structs.ServiceID, proxyMode structs.ProxyMode) (uint64, *configentry.ResolvedServiceConfigSet, error)
AbandonCh() <-chan struct{}
}
type Watcher ¶
type Watcher interface {
Watch(proxyID structs.ServiceID, nodeName string, token string) (<-chan *proxycfg.ConfigSnapshot, limiter.SessionTerminatedChan, proxycfg.CancelFunc, error)
}