application

package
v1.94.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Approved = State{
	Name:      "approved",
	EnterFunc: ApproveVersion,
}
View Source
var Associated = State{
	Name:      "associated",
	EnterFunc: AssociateVersion,
}
View Source
var EditionConfirmed = State{
	Name:      "edition-confirmed",
	EnterFunc: EditionConfirmVersion,
}
View Source
var Published = State{
	Name:      "published",
	EnterFunc: PublishVersion,
}

Functions

func ApproveVersion added in v1.81.2

func ApproveVersion(ctx context.Context, smDS *StateMachineDatasetAPI,
	currentVersion *models.Version,
	versionUpdate *models.Version,
	versionDetails VersionDetails,
	hasDownloads string) error

func AssociateVersion

func AssociateVersion(ctx context.Context, smDS *StateMachineDatasetAPI,
	currentVersion *models.Version,
	versionUpdate *models.Version,
	versionDetails VersionDetails,
	hasDownloads string) error

func EditionConfirmVersion

func EditionConfirmVersion(ctx context.Context, smDS *StateMachineDatasetAPI,
	currentVersion *models.Version,
	versionUpdate *models.Version,
	versionDetails VersionDetails,
	_ string) error

func PublishDataset

func PublishDataset(ctx context.Context, smDS *StateMachineDatasetAPI,
	currentVersion *models.Version,
	versionUpdate *models.Version,
	versionDetails VersionDetails,
	data log.Data) error

func PublishEdition

func PublishEdition(ctx context.Context, smDS *StateMachineDatasetAPI,
	versionUpdate *models.Version,
	versionDetails VersionDetails, data log.Data) error

func PublishInstance

func PublishInstance(ctx context.Context, smDS *StateMachineDatasetAPI,
	versionUpdate *models.Version,
	data log.Data) error

func PublishVersion

func PublishVersion(ctx context.Context, smDS *StateMachineDatasetAPI,
	currentVersion *models.Version,
	versionUpdate *models.Version,
	versionDetails VersionDetails,
	hasDownloads string) error

func UpdateVersionInfo

func UpdateVersionInfo(ctx context.Context, smDS *StateMachineDatasetAPI,
	currentVersion *models.Version,
	versionUpdate *models.Version,
	versionDetails VersionDetails) (updatedVersion *models.Version, err error)

Types

type DownloadsGenerator

type DownloadsGenerator interface {
	Generate(ctx context.Context, datasetID, instanceID, edition, version string) error
}

type KeyVal

type KeyVal struct {
	StateVal string
	Type     string
}

type State

type State struct {
	Name      string
	EnterFunc func(ctx context.Context, smDS *StateMachineDatasetAPI,
		currentVersion *models.Version,
		versionUpdate *models.Version,
		versionDetails VersionDetails,
		hasDownloads string) error
}

func (State) String

func (s State) String() string

type StateMachine

type StateMachine struct {
	DataStore store.DataStore
	// 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, smDS *StateMachineDatasetAPI,
	currentVersion *models.Version,
	versionUpdate *models.Version,
	versionDetails VersionDetails,
	hasDownloads string) error

type StateMachineDatasetAPI

type StateMachineDatasetAPI struct {
	DataStore          store.DataStore
	DownloadGenerators map[models.DatasetType]DownloadsGenerator
	StateMachine       *StateMachine
}

func Setup

func Setup(dataStoreVal store.DataStore, downloadGenerators map[models.DatasetType]DownloadsGenerator, stateMachine *StateMachine) *StateMachineDatasetAPI

func (*StateMachineDatasetAPI) AmendVersion

func (smDS *StateMachineDatasetAPI) AmendVersion(ctx context.Context, vars map[string]string, version *models.Version) (*models.Version, error)

func (*StateMachineDatasetAPI) DeleteStaticVersion added in v1.89.0

func (smDS *StateMachineDatasetAPI) DeleteStaticVersion(ctx context.Context, datasetID, edition string, version int, filesAPIClient filesAPISDK.Clienter) error

func (*StateMachineDatasetAPI) PopulateVersionInfo

func (smDS *StateMachineDatasetAPI) PopulateVersionInfo(ctx context.Context, versionUpdate *models.Version, versionDetails VersionDetails) (currentVersion, combinedVersionUpdate *models.Version, err error)

type Transition

type Transition struct {
	Label               string
	TargetState         State
	AllowedSourceStates []string
	Type                string
}

type VersionDetails

type VersionDetails struct {
	// contains filtered or unexported fields
}

VersionDetails contains the details that uniquely identify a version resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL