catalog

package
v1.16.109 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MPL-2.0 Imports: 12 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

	// 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

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 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

Watch provides a mock function with given fields: req

type MockSessionLimiter

type MockSessionLimiter struct {
	mock.Mock
}

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

type MockWatcher struct {
	mock.Mock
}

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

Watch provides a mock function with given fields: proxyID, nodeName, token

type SessionLimiter

type SessionLimiter interface {
	BeginSession() (limiter.Session, error)
}

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)
}

Jump to

Keyboard shortcuts

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