func (sc *StateConfiguration) Permit(trigger Trigger, destinationState State, guards ...GuardFunc) *StateConfiguration {
	if destinationState == sc.sr.State {
		panic("stateless: Permit() require that the destination state is not equal to the source state. To accept a trigger without changing state, use either Ignore() or PermitReentry().")
	}
	sc.sr.AddTriggerBehaviour(&transitioningTriggerBehaviour{
		baseTriggerBehaviour: baseTriggerBehaviour{Trigger: trigger, Guard: newtransitionGuard(guards...)},
		Destination:          destinationState,
	})
	return sc
}
Permit accept the specified trigger and transition to the destination state if the guard conditions are met (if any).
package stateless
import (
	"context"
	"fmt"
)
type transitionKey struct{}
func withTransition(ctx context.Context, transition Transition) context.Context {
	return context.WithValue(ctx, transitionKey{}, transition)
}
func GetTransition(ctx context.Context) Transition {
	return ctx.Value(transitionKey{}).(Transition)
}
type ActionFunc = func(ctx context.Context, args ...interface{}) error
type GuardFunc = func(ctx context.Context, args ...interface{}) bool
type DestinationSelectorFunc = func(ctx context.Context, args ...interface{}) (State, error)
type StateConfiguration struct {
	sm     *StateMachine
	sr     *stateRepresentation
	lookup func(State) *stateRepresentation
}
func (sc *StateConfiguration) State() State {
	return sc.sr.State
}
func (sc *StateConfiguration) Machine() *StateMachine {
	return sc.sm
}
func (sc *StateConfiguration) InitialTransition(targetState State) *StateConfiguration {
	if sc.sr.HasInitialState {
		panic(fmt.Sprintf("stateless: This state has already been configured with an initial transition (%v).", sc.sr.InitialTransitionTarget))
	}
	if targetState == sc.State() {
		panic("stateless: Setting the current state as the target destination state is not allowed.")
	}
	sc.sr.SetInitialTransition(targetState)
	return sc
}