state

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

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	*domain.StateBase
}

State represents database interactions dealing with controller nodes.

func NewState

func NewState(factory database.TxnRunnerFactory) *State

NewState returns a new controller node state based on the input database factory method.

func (*State) CurateNodes

func (st *State) CurateNodes(ctx context.Context, insert, delete []string) error

CurateNodes accepts slices of controller IDs to insert and delete from the controller node table.

func (*State) SelectDatabaseNamespace

func (st *State) SelectDatabaseNamespace(ctx context.Context, namespace string) (string, error)

SelectDatabaseNamespace is responsible for selecting and returning the database namespace specified by namespace. If no namespace is registered an error satisfying errors.NotFound is returned.

func (*State) UpdateDqliteNode

func (st *State) 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. It is a no-op if they are already set to the same values.

Jump to

Keyboard shortcuts

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