Documentation
¶
Index ¶
- func GetSubject(ctx context.Context) (interface{}, bool)
- func SetSubject(ctx context.Context, subj interface{}) context.Context
- type ListenerInterface
- type Net
- type StateInterface
- type StateOpInterface
- type StateReadInterface
- type StubListener
- func (l *StubListener) AfterStart(ctx context.Context)
- func (l *StubListener) AfterTransition(ctx context.Context, transitionID string, state StateOpInterface)
- func (l *StubListener) BeforeStart(ctx context.Context) error
- func (l *StubListener) BeforeTransition(ctx context.Context, transitionID string, state StateOpInterface) error
- func (l *StubListener) GetStateListener() state.ListenerInterface
- func (l *StubListener) HasStateListener() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSubject ¶
Types ¶
type ListenerInterface ¶
type ListenerInterface interface { BeforeStart(ctx context.Context) error AfterStart(ctx context.Context) BeforeTransition(ctx context.Context, transitionID string, state StateOpInterface) error AfterTransition(ctx context.Context, transitionID string, state StateOpInterface) HasStateListener() bool GetStateListener() state.ListenerInterface }
type Net ¶
type Net struct {
// contains filtered or unexported fields
}
func (*Net) Start ¶
func (n *Net) Start(ctx context.Context, s StateInterface) error
Start workflow net.
Use ctx for cancel operation and send subject of operation.
func (*Net) Transit ¶
Transit to new places(state).
Use ctx for cancel operation and send subject of operation.
func (*Net) WithListener ¶
func (n *Net) WithListener(listener ListenerInterface)
type StateInterface ¶
type StateInterface interface { StateOpInterface WithListener(listener state.ListenerInterface) MoveTokensFromPlacesToPlaces(ctx context.Context, from []string, to []string) error }
type StateOpInterface ¶
type StateOpInterface interface { StateReadInterface SetFinished() error AddError(err error) }
type StateReadInterface ¶
type StubListener ¶
type StubListener struct{}
func NewStubListener ¶
func NewStubListener() *StubListener
func (*StubListener) AfterStart ¶
func (l *StubListener) AfterStart(ctx context.Context)
func (*StubListener) AfterTransition ¶
func (l *StubListener) AfterTransition(ctx context.Context, transitionID string, state StateOpInterface)
func (*StubListener) BeforeStart ¶
func (l *StubListener) BeforeStart(ctx context.Context) error
func (*StubListener) BeforeTransition ¶
func (l *StubListener) BeforeTransition(ctx context.Context, transitionID string, state StateOpInterface) error
func (*StubListener) GetStateListener ¶
func (l *StubListener) GetStateListener() state.ListenerInterface
func (*StubListener) HasStateListener ¶
func (l *StubListener) HasStateListener() bool
Click to show internal directories.
Click to hide internal directories.