Documentation
¶
Index ¶
- func Generate(pkg string, model *FsmModel) *jen.File
- func GetAttempt(ctx context.Context) int
- func InMemory() func() (Store, error)
- func Logger(ctx context.Context) *slog.Logger
- func OnDisk(path string) func() (Store, error)
- func PutAttempt(ctx context.Context, attempt int) context.Context
- func PutLogger(ctx context.Context, logger *slog.Logger) context.Context
- func PutState(ctx context.Context, id State) context.Context
- func PutTaskID(ctx context.Context, id TaskID) context.Context
- type Backoff
- type CompletionListener
- type FsmModel
- func (s *FsmModel) FsmBuilderConstructorName() string
- func (s *FsmModel) FsmBuilderFinalStageName() string
- func (s *FsmModel) FsmBuilderName() string
- func (s *FsmModel) FsmBuilderStageMethodName(state StateModel) string
- func (s *FsmModel) FsmBuilderStageName(state StateModel) string
- func (s *FsmModel) FsmInternalName() string
- func (s *FsmModel) FsmName() string
- func (s *FsmModel) FsmStateInternalName(state StateModel) string
- func (s *FsmModel) FsmStateMessageName(state StateModel) string
- func (s *FsmModel) FsmStateProcessorName(state StateModel) string
- func (s *FsmModel) FsmStateQueueInternalName(state StateModel) string
- func (s *FsmModel) GetState(name State) StateModel
- func (s *FsmModel) InitialState() StateModel
- func (s *FsmModel) RenderType(name string) jen.Code
- func (s *FsmModel) StateName(state StateModel) string
- func (s *FsmModel) StateTypeName() string
- func (s *FsmModel) TransitionToName(to State) string
- func (s *FsmModel) TransitionsParamTypeName(state StateModel) string
- type GeneratorOptions
- type Option
- type Q
- type State
- type StateModel
- type Store
- type SupportsOptions
- type TaskID
- type TransitionListener
- type TypeModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAttempt ¶
Types ¶
type FsmModel ¶
type FsmModel struct {
Name string `yaml:"name"`
Types map[string]TypeModel `yaml:"types"`
States []StateModel `yaml:"states"`
}
func (*FsmModel) FsmBuilderConstructorName ¶
func (*FsmModel) FsmBuilderFinalStageName ¶
func (*FsmModel) FsmBuilderName ¶
func (*FsmModel) FsmBuilderStageMethodName ¶
func (s *FsmModel) FsmBuilderStageMethodName(state StateModel) string
func (*FsmModel) FsmBuilderStageName ¶
func (s *FsmModel) FsmBuilderStageName(state StateModel) string
func (*FsmModel) FsmInternalName ¶
func (*FsmModel) FsmStateInternalName ¶
func (s *FsmModel) FsmStateInternalName(state StateModel) string
func (*FsmModel) FsmStateMessageName ¶
func (s *FsmModel) FsmStateMessageName(state StateModel) string
func (*FsmModel) FsmStateProcessorName ¶
func (s *FsmModel) FsmStateProcessorName(state StateModel) string
func (*FsmModel) FsmStateQueueInternalName ¶
func (s *FsmModel) FsmStateQueueInternalName(state StateModel) string
func (*FsmModel) GetState ¶
func (s *FsmModel) GetState(name State) StateModel
func (*FsmModel) InitialState ¶
func (s *FsmModel) InitialState() StateModel
func (*FsmModel) StateName ¶
func (s *FsmModel) StateName(state StateModel) string
func (*FsmModel) StateTypeName ¶
func (*FsmModel) TransitionToName ¶
func (*FsmModel) TransitionsParamTypeName ¶
func (s *FsmModel) TransitionsParamTypeName(state StateModel) string
type GeneratorOptions ¶
func ParseFlags ¶
func ParseFlags() (input string, opts GeneratorOptions, err error)
type Option ¶
type Option func(SupportsOptions) error
func WithBackoff ¶
func WithCompletionListener ¶
func WithCompletionListener(listener CompletionListener) Option
func WithLogger ¶
func WithTransitionListener ¶
func WithTransitionListener(listener TransitionListener) Option
type State ¶
type State string
const StateError State = "__error__"
StateError is used to indicate an error during a state transition.
type StateModel ¶
type SupportsOptions ¶
type SupportsOptions interface {
WithContext(update func(ctx context.Context) context.Context)
WithStore(store Store)
WithBackoff(backoff Backoff)
WithTransitionListener(listener TransitionListener)
WithCompletionListener(listener CompletionListener)
}
type TransitionListener ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.