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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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