state

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCouldNotCreateDirectory = fmt.Errorf("could not create state directory")
	ErrCouldNotOpenFile        = fmt.Errorf("could not open state file")
	ErrCouldNotReadFile        = fmt.Errorf("could not read state file")
	ErrFileCorrupted           = fmt.Errorf("state file corrupted, could not unmarshal")
	ErrCouldNotWriteFile       = fmt.Errorf("could not write state file")
	ErrOnlyLocalStateSupported = fmt.Errorf("only local state is supported")
)
View Source
var (
	ErrUnsupportedStateType = errors.New("unsupported state type")
)

Functions

func NewLocalStateManager

func NewLocalStateManager(statePath string, id uuid.UUID) definitions.StateManager

func NewMultipleStateTypesManager

func NewMultipleStateTypesManager(stateManagers map[definitions.StateType]definitions.StateManager) definitions.StateManager

func NewStateManagerFactory

func NewStateManagerFactory(zkClient *zk.Conn, localStatePath string, zookeeperPath string) definitions.StateManagerFactory

Types

type MultipleStateTypesManager

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

func (*MultipleStateTypesManager) Close

func (m *MultipleStateTypesManager) Close() error

func (*MultipleStateTypesManager) GetState

func (m *MultipleStateTypesManager) GetState(stateType definitions.StateType) (map[string]any, error)

func (*MultipleStateTypesManager) GetStateManagers

func (*MultipleStateTypesManager) Reset

func (m *MultipleStateTypesManager) Reset() error

func (*MultipleStateTypesManager) SetState

func (m *MultipleStateTypesManager) SetState(stateType definitions.StateType, state map[string]any) error

func (*MultipleStateTypesManager) WatchState

func (m *MultipleStateTypesManager) WatchState(state definitions.StateType, callback func()) error

Jump to

Keyboard shortcuts

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