service

package
v0.0.0-...-0db00f2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitialNamespaceChanges = eventsource.InitialNamespaceChanges

It's for testing.

Functions

This section is empty.

Types

type ModificationValidatorFunc

type ModificationValidatorFunc = func(map[string]string) error

ModificationValidatorFunc is a function that validates a modification to the controller config.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service defines a service for interacting with the underlying state.

func NewService

func NewService(st State) *Service

NewService returns a new Service for interacting with the underlying state.

func (*Service) ControllerConfig

func (s *Service) ControllerConfig(ctx context.Context) (controller.Config, error)

ControllerConfig returns the config values for the controller.

func (*Service) UpdateControllerConfig

func (s *Service) UpdateControllerConfig(ctx context.Context, updateAttrs controller.Config, removeAttrs []string) error

UpdateControllerConfig updates the controller config.

type State

type State interface {
	ControllerConfig(context.Context) (map[string]string, error)
	UpdateControllerConfig(ctx context.Context, updateAttrs map[string]string, removeAttrs []string, validateModification ModificationValidatorFunc) error

	// AllKeysQuery is used to get the initial state
	// for the controller configuration watcher.
	AllKeysQuery() string
}

State defines an interface for interacting with the underlying state.

type WatchableService

type WatchableService struct {
	Service
	// contains filtered or unexported fields
}

WatchableService defines a service for interacting with the underlying state and the ability to create watchers.

func NewWatchableService

func NewWatchableService(st State, wf WatcherFactory) *WatchableService

NewWatchableService returns a new Service for interacting with the underlying state and the ability to create watchers.

func (*WatchableService) WatchControllerConfig

func (s *WatchableService) WatchControllerConfig() (watcher.StringsWatcher, error)

Watch returns a watcher that returns keys for any changes to controller config.

type WatcherFactory

type WatcherFactory interface {
	// NewNamespaceWatcher returns a new namespace watcher
	// for events based on the input change mask.
	NewNamespaceWatcher(string, changestream.ChangeType, eventsource.NamespaceQuery) (watcher.StringsWatcher, error)
}

WatcherFactory describes methods for creating watchers.

Jump to

Keyboard shortcuts

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