store

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

type DataStore struct {
	Backend Storer
}

DataStore provides a datastore.Storer interface used to store, retrieve, remove or update datasets

type Storer

type Storer interface {
	AddDimensionToInstance(dimension *models.CachedDimensionOption) error
	AddEventToInstance(instanceID string, event *models.Event) error
	AddInstance(instance *models.Instance) (*models.Instance, error)
	CheckDatasetExists(ID, state string) error
	CheckEditionExists(ID, editionID, state string) error
	GetDataset(ID string) (*models.DatasetUpdate, error)
	GetDatasets(ctx context.Context) ([]models.DatasetUpdate, error)
	GetDimensionsFromInstance(ID string) (*models.DimensionNodeResults, error)
	GetDimensions(datasetID, versionID string) ([]bson.M, error)
	GetDimensionOptions(version *models.Version, dimension string) (*models.DimensionOptionResults, error)
	GetEdition(ID, editionID, state string) (*models.EditionUpdate, error)
	GetEditions(ctx context.Context, ID, state string) (*models.EditionUpdateResults, error)
	GetInstances(ctx context.Context, states []string, datasets []string) (*models.InstanceResults, error)
	GetInstance(ID string) (*models.Instance, error)
	GetNextVersion(datasetID, editionID string) (int, error)
	GetUniqueDimensionAndOptions(ID, dimension string) (*models.DimensionValues, error)
	GetVersion(datasetID, editionID, version, state string) (*models.Version, error)
	GetVersions(ctx context.Context, datasetID, editionID, state string) (*models.VersionResults, error)
	UpdateDataset(ctx context.Context, ID string, dataset *models.Dataset, currentState string) error
	UpdateDatasetWithAssociation(ID, state string, version *models.Version) error
	UpdateDimensionNodeID(dimension *models.DimensionOption) error
	UpdateInstance(ctx context.Context, ID string, instance *models.Instance) error
	UpdateObservationInserted(ID string, observationInserted int64) error
	UpdateImportObservationsTaskState(id, state string) error
	UpdateBuildHierarchyTaskState(id, dimension, state string) error
	UpdateBuildSearchTaskState(id, dimension, state string) error
	UpdateVersion(ID string, version *models.Version) error
	UpsertContact(ID string, update interface{}) error
	UpsertDataset(ID string, datasetDoc *models.DatasetUpdate) error
	UpsertEdition(datasetID, edition string, editionDoc *models.EditionUpdate) error
	UpsertVersion(ID string, versionDoc *models.Version) error
	DeleteDataset(ID string) error
	DeleteEdition(ID string) error

	AddVersionDetailsToInstance(ctx context.Context, instanceID string, datasetID string, edition string, version int) error
	SetInstanceIsPublished(ctx context.Context, instanceID string) error
	StreamCSVRows(ctx context.Context, instanceID, filterID string, filters *observation.DimensionFilters, limit *int) (observation.StreamRowReader, error)
}

Storer represents basic data access via Get, Remove and Upsert methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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