state

package
v5.0.0-beta5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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