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 ¶
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
Click to show internal directories.
Click to hide internal directories.