Documentation
¶
Index ¶
- Variables
- type State
- type StateMachine
- type StateMachineBundleAPI
- func (s *StateMachineBundleAPI) CheckAllBundleContentsAreApproved(ctx context.Context, bundleID string) (bool, error)
- func (s *StateMachineBundleAPI) CheckBundleExists(ctx context.Context, bundleID string) (bool, error)
- func (s *StateMachineBundleAPI) CheckContentItemExistsByDatasetEditionVersion(ctx context.Context, datasetID, editionID string, versionID int) (bool, error)
- func (s *StateMachineBundleAPI) CreateBundleEvent(ctx context.Context, event *models.Event) error
- func (s *StateMachineBundleAPI) CreateContentItem(ctx context.Context, contentItem *models.ContentItem) error
- func (s *StateMachineBundleAPI) GetBundle(ctx context.Context, bundleID string) (*models.Bundle, error)
- func (s *StateMachineBundleAPI) ListBundleEvents(ctx context.Context, offset, limit int, bundleID string, ...) ([]*models.Event, int, error)
- func (s *StateMachineBundleAPI) ListBundles(ctx context.Context, offset, limit int, filters *filters.BundleFilters) ([]*models.Bundle, int, error)
- func (s *StateMachineBundleAPI) UpdateBundleETag(ctx context.Context, bundleID, email string) (*models.Bundle, error)
- type Transition
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) CheckBundleExists ¶ added in v1.3.0
func (*StateMachineBundleAPI) CheckContentItemExistsByDatasetEditionVersion ¶ added in v1.3.0
func (*StateMachineBundleAPI) CreateBundleEvent ¶ added in v1.3.0
func (*StateMachineBundleAPI) CreateContentItem ¶ added in v1.3.0
func (s *StateMachineBundleAPI) CreateContentItem(ctx context.Context, contentItem *models.ContentItem) error
func (*StateMachineBundleAPI) ListBundleEvents ¶ added in v1.3.0
func (*StateMachineBundleAPI) ListBundles ¶
func (s *StateMachineBundleAPI) ListBundles(ctx context.Context, offset, limit int, filters *filters.BundleFilters) ([]*models.Bundle, int, error)
func (*StateMachineBundleAPI) UpdateBundleETag ¶ added in v1.3.0
type Transition ¶
Click to show internal directories.
Click to hide internal directories.