state

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithState

func RunWithState(stateCfg storage.StorageConfig, dryrun, debug bool, f func(stateRef *model.State) error) error

RunWithState is a helper function that initializes the state service, loads the state, executes the provided function with the state reference, and saves the state back if not a dry run. function f should accept a pointer to model.State and return an error and NEVER panic or Exit itself (except for fail fast strategy).

Types

type StateError

type StateError struct {
	Cause   error
	Message string
}

StateError represents a general state-related error.

func NewStateError

func NewStateError(message string, cause error) *StateError

func (*StateError) Error

func (e *StateError) Error() string

func (*StateError) Unwrap

func (e *StateError) Unwrap() error

type StateService

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

func NewStateService

func NewStateService(config storage.StorageConfig, debug bool) *StateService

func (*StateService) LoadState

func (s *StateService) LoadState(debug bool) (*model.State, error)

func (*StateService) SaveState

func (s *StateService) SaveState(state *model.State, dryrun, debug bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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