Documentation
¶
Index ¶
- func CanTransition(from, to domain.State) bool
- func GetNextStates(from domain.State) []domain.State
- func IsActiveProcessingState(state domain.State) bool
- func IsAllowedStateForJobUpdate(state domain.State) bool
- func IsFailureState(state domain.State) bool
- func IsRejectedOrReverting(state domain.State) bool
- func IsTerminalState(state domain.State) bool
- func ValidateTransition(from, to domain.State) error
- type TransitionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanTransition ¶
CanTransition returns true if a transition from `from` to `to` is allowed.
func GetNextStates ¶
GetNextStates returns all valid next states from the given state.
func IsActiveProcessingState ¶ added in v0.26.0
IsActiveProcessingState returns true if the state represents an active processing state that should notify on completion
func IsAllowedStateForJobUpdate ¶
IsAllowedStateForJobUpdate checks if the state is allowed for the job update endpoint
func IsFailureState ¶
IsFailureState returns true if the state represents a failure condition.
func IsRejectedOrReverting ¶
IsRejectedOrReverting returns true if the state is rejected or reverting.
func IsTerminalState ¶
IsTerminalState returns true if the state has no outgoing transitions.
func ValidateTransition ¶
ValidateTransition validates a transition or returns a TransitionError.
Types ¶
type TransitionError ¶
TransitionError is returned when an invalid transition is requested.
func (*TransitionError) Error ¶
func (e *TransitionError) Error() string
Error returns the error message for a TransitionError.