service

package
v0.0.0-...-1f8c1e5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service provides the API for working with controller nodes.

func NewService

func NewService(st State) *Service

NewService returns a new service reference wrapping the input state.

func (*Service) CurateNodes

func (s *Service) CurateNodes(ctx context.Context, toAdd, toRemove []string) error

CurateNodes modifies the known control plane by adding and removing controller node records according to the input slices.

func (*Service) IsKnownDatabaseNamespace

func (s *Service) IsKnownDatabaseNamespace(ctx context.Context, namespace string) (bool, error)

IsKnownDatabaseNamespace reports if the namespace is known to the controller. If the namespace is not valid an error satisfying errors.NotValid is returned.

func (*Service) UpdateDqliteNode

func (s *Service) UpdateDqliteNode(ctx context.Context, controllerID string, nodeID uint64, addr string) error

UpdateDqliteNode sets the Dqlite node ID and bind address for the input controller ID.

type State

type State interface {
	CurateNodes(context.Context, []string, []string) error
	UpdateDqliteNode(context.Context, string, uint64, string) error
	SelectDatabaseNamespace(context.Context, string) (string, error)
}

State describes retrieval and persistence methods for controller node concerns.

Jump to

Keyboard shortcuts

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