catalog

package
v1.13.0-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2022 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

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

type MockConfigManager struct {
	mock.Mock
}

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

Watch provides a mock function with given fields: req

type MockWatcher

type MockWatcher struct {
	mock.Mock
}

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

type Store

type Store interface {
	NodeService(ws memdb.WatchSet, nodeName string, serviceID string, entMeta *acl.EnterpriseMeta, peerName string) (uint64, *structs.NodeService, error)
	AbandonCh() <-chan struct{}
}

type Watcher

type Watcher interface {
	Watch(proxyID structs.ServiceID, nodeName string, token string) (<-chan *proxycfg.ConfigSnapshot, proxycfg.CancelFunc, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL