application

package
v1.89.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) 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