state

package
v0.0.0-...-c943012 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 1 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func()

type Event

type Event int
const (
	Start Event = iota
	Shutdown
	Exit
	Restart
)

func (Event) String

func (e Event) String() string

type Options

type Options struct {
	Timeout time.Duration
	Logger  *log.Logger
}

type State

type State int
const (
	NotStarted State = iota
	Running
	Stopping
	Exited
)

func (State) String

func (s State) String() string

type StateMachine

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

func New

func New(cmd command.Command, opts Options) *StateMachine

func (*StateMachine) SendEvent

func (sm *StateMachine) SendEvent(ev Event)

Jump to

Keyboard shortcuts

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