Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Draft = State{Name: "DRAFT"} InReview = State{Name: "IN_REVIEW"} Approved = State{Name: "APPROVED"} Published = State{Name: "PUBLISHED"} )
list of states for the state machine
Functions ¶
This section is empty.
Types ¶
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}
func NewStateMachine ¶
func NewStateMachine(ctx context.Context, states []State, transitions []Transition, datastore store.Datastore) *StateMachine
func (*StateMachine) Transition ¶
func (sm *StateMachine) Transition(ctx context.Context, stateMachineBundleAPI *StateMachineBundleAPI, currentBundle, bundleUpdate *models.Bundle) error
type StateMachineBundleAPI ¶
type StateMachineBundleAPI struct {
Datastore store.Datastore
StateMachine *StateMachine
}
func Setup ¶
func Setup(datastore store.Datastore, stateMachine *StateMachine) *StateMachineBundleAPI
func (*StateMachineBundleAPI) CheckAllBundleContentsAreApproved ¶
func (*StateMachineBundleAPI) ListBundles ¶
type Transition ¶
Click to show internal directories.
Click to hide internal directories.