state

package
v8.0.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUnkownStateError

func IsUnkownStateError(err error) bool

Types

type Machine

type Machine struct {
	Logger       micrologger.Logger
	ResourceName string
	Transitions  TransitionMap
}

Machine is a simple type to hold state machine configuration.

func (Machine) Execute

func (m Machine) Execute(ctx context.Context, obj interface{}, currentState State) (State, error)

type State

type State string

type TransitionFunc

type TransitionFunc func(ctx context.Context, obj interface{}, currentState State) (State, error)

TransitionFunc defines state transition function signature.

type TransitionMap

type TransitionMap map[State]TransitionFunc

Jump to

Keyboard shortcuts

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