Documentation
¶
Index ¶
- Constants
- Variables
- func ApproveVersion(ctx context.Context, smDS *StateMachineDatasetAPI, ...) error
- func AssociateVersion(ctx context.Context, smDS *StateMachineDatasetAPI, ...) error
- func EditionConfirmVersion(ctx context.Context, smDS *StateMachineDatasetAPI, ...) error
- func PublishDataset(ctx context.Context, smDS *StateMachineDatasetAPI, ...) error
- func PublishEdition(ctx context.Context, smDS *StateMachineDatasetAPI, ...) error
- func PublishInstance(ctx context.Context, smDS *StateMachineDatasetAPI, ...) error
- func PublishVersion(ctx context.Context, smDS *StateMachineDatasetAPI, ...) error
- func PublishVersionInfo(ctx context.Context, smDS *StateMachineDatasetAPI, ...) (updatedVersion *models.Version, err error)
- func UpdateVersionInfo(ctx context.Context, smDS *StateMachineDatasetAPI, ...) (updatedVersion *models.Version, err error)
- type AuditService
- type DownloadsGenerator
- type KeyVal
- type SearchContentUpdatedProducer
- type State
- type StateMachine
- type StateMachineDatasetAPI
- func (smDS *StateMachineDatasetAPI) AmendVersion(ctx context.Context, vars map[string]string, version *models.Version, ...) (*models.Version, error)
- func (smDS *StateMachineDatasetAPI) DeleteStaticVersion(ctx context.Context, datasetID, edition string, version int, ...) (*models.Version, error)
- func (smDS *StateMachineDatasetAPI) PopulateVersionInfo(ctx context.Context, versionUpdate *models.Version, ...) (currentVersion, combinedVersionUpdate *models.Version, err error)
- type StaticDatasetService
- type Transition
- type VersionDetails
Constants ¶
View Source
const AccessTokenKey contextKey = "access_token"
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, authEntityData *sdk.EntityData, accessToken string) error
func AssociateVersion ¶
func AssociateVersion(ctx context.Context, smDS *StateMachineDatasetAPI, currentVersion *models.Version, versionUpdate *models.Version, versionDetails VersionDetails, hasDownloads string, authEntityData *sdk.EntityData, accessToken string) error
func EditionConfirmVersion ¶
func EditionConfirmVersion(ctx context.Context, smDS *StateMachineDatasetAPI, currentVersion *models.Version, versionUpdate *models.Version, versionDetails VersionDetails, _ string, authEntityData *sdk.EntityData, accessToken string) error
func PublishDataset ¶
func PublishEdition ¶
func PublishEdition(ctx context.Context, smDS *StateMachineDatasetAPI, versionUpdate *models.Version, versionDetails VersionDetails, data log.Data) error
func PublishInstance ¶
func PublishVersion ¶
func PublishVersion(ctx context.Context, smDS *StateMachineDatasetAPI, currentVersion *models.Version, versionUpdate *models.Version, versionDetails VersionDetails, hasDownloads string, authEntityData *sdk.EntityData, accessToken string) error
func PublishVersionInfo ¶ added in v1.112.0
func PublishVersionInfo(ctx context.Context, smDS *StateMachineDatasetAPI, currentVersion *models.Version, versionUpdate *models.Version, versionDetails VersionDetails, authEntityData *sdk.EntityData, accessToken string) (updatedVersion *models.Version, err error)
func UpdateVersionInfo ¶
Types ¶
type AuditService ¶ added in v1.98.0
type AuditService interface {
RecordDatasetAuditEvent(ctx context.Context, requestedBy models.RequestedBy, action models.Action, resource string, dataset *models.Dataset) error
RecordVersionAuditEvent(ctx context.Context, requestedBy models.RequestedBy, action models.Action, resource string, version *models.Version) error
RecordEditionAuditEvent(ctx context.Context, requestedBy models.RequestedBy, action models.Action, resource string, edition *models.Edition) error
RecordMetadataAuditEvent(ctx context.Context, requestedBy models.RequestedBy, action models.Action, resource string, metadata *models.Metadata) error
}
AuditService defines the interface for audit logging
func NewAuditService ¶ added in v1.98.0
func NewAuditService(dataStore store.DataStore) AuditService
NewAuditService creates a new instance of AuditService
type DownloadsGenerator ¶
type SearchContentUpdatedProducer ¶ added in v1.112.0
type SearchContentUpdatedProducer struct {
Producer download.KafkaProducer
}
type State ¶
type State struct {
Name string
EnterFunc func(ctx context.Context, smDS *StateMachineDatasetAPI,
currentVersion *models.Version,
versionUpdate *models.Version,
versionDetails VersionDetails,
hasDownloads string,
authEntityData *sdk.EntityData,
accessToken string) error
}
type StateMachine ¶
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, authEntityData *sdk.EntityData, accessToken string) error
type StateMachineDatasetAPI ¶
type StateMachineDatasetAPI struct {
DataStore store.DataStore
DownloadGenerators map[models.DatasetType]DownloadsGenerator
StateMachine *StateMachine
FilesAPIClient filesAPISDK.Clienter
SearchContentUpdatedProducer *SearchContentUpdatedProducer
CloudflareClient cloudflare.Clienter
CloudflareEnabled bool
UrlBuilder *url.Builder
}
func Setup ¶
func Setup(dataStoreVal store.DataStore, downloadGenerators map[models.DatasetType]DownloadsGenerator, stateMachine *StateMachine, searchContentUpdatedProducer *SearchContentUpdatedProducer, cloudflareClient cloudflare.Clienter, cloudflareEnabled bool, urlBuilder *url.Builder, filesAPIClient filesAPISDK.Clienter) *StateMachineDatasetAPI
func (*StateMachineDatasetAPI) AmendVersion ¶
func (*StateMachineDatasetAPI) DeleteStaticVersion ¶ added in v1.89.0
func (*StateMachineDatasetAPI) PopulateVersionInfo ¶
func (smDS *StateMachineDatasetAPI) PopulateVersionInfo(ctx context.Context, versionUpdate *models.Version, versionDetails VersionDetails) (currentVersion, combinedVersionUpdate *models.Version, err error)
type StaticDatasetService ¶ added in v1.112.0
type StaticDatasetService interface {
GetVersionPublic(ctx context.Context, datasetID, editionID string, versionID int) (*models.Version, error)
GetVersionPrivate(ctx context.Context, datasetID, editionID string, versionID int) (*models.Version, error)
}
StaticDatasetService defines the interface for operations related to static datasets, editions, and versions.
WARNING: Before calling any method, the caller must ensure the following conditions are met:
- The dataset exists
- The dataset type is "static"
These checks are not performed here to avoid duplicate database calls and optimise performance. Handlers are expected to have already performed these checks before calling this service.
func NewStaticDatasetService ¶ added in v1.112.0
func NewStaticDatasetService(dataStore store.DataStore) StaticDatasetService
NewStaticDatasetService creates a new instance of StaticDatasetService.
type Transition ¶
type VersionDetails ¶
type VersionDetails struct {
// contains filtered or unexported fields
}
VersionDetails contains the details that uniquely identify a version resource
Source Files
¶
Click to show internal directories.
Click to hide internal directories.