Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeDatasetCumulativeState(api *metax.MetaxService, db *psql.DB, logger *zerolog.Logger, ...) (newQVersionId *uuid.UUID, err error)
- func Fetch(api *metax.MetaxService, db *psql.DB, logger zerolog.Logger, uid uuid.UUID, ...) error
- func FetchAll(api *metax.MetaxService, db *psql.DB, logger zerolog.Logger, uid uuid.UUID, ...) error
- func FetchDataset(api *metax.MetaxService, db *psql.DB, logger zerolog.Logger, uid uuid.UUID, ...) (*uuid.UUID, error)
- func FetchSince(api *metax.MetaxService, db *psql.DB, logger zerolog.Logger, uid uuid.UUID, ...) error
- func Publish(api *metax.MetaxService, db *psql.DB, id uuid.UUID, owner *models.User) (versionId string, newVersionId string, newQVersionId *uuid.UUID, err error)
- func RefreshDatasetDirectoryContent(api *metax.MetaxService, db *psql.DB, logger *zerolog.Logger, ...) (newQVersionId *uuid.UUID, err error)
- func UnpublishAndDelete(api *metax.MetaxService, db *psql.DB, id uuid.UUID, owner uuid.UUID) error
Constants ¶
const ( SyncWritten = iota SyncDeleted = iota SyncSkipped = iota SyncFailed = iota )
const DefaultRequestTimeout = 15 * time.Second
const ( // PublishTimeout is how long we wait for response when publishling or unpublishing PublishTimeout = 10 * time.Second )
Variables ¶
var ( // ErrNoIdentifier means we can't find the Metax dataset identifier in created or updated datasets. ErrNoIdentifier = errors.New("no identifier in dataset") )
Functions ¶
func ChangeDatasetCumulativeState ¶ added in v0.10.3
func ChangeDatasetCumulativeState(api *metax.MetaxService, db *psql.DB, logger *zerolog.Logger, owner *models.User, id uuid.UUID, cumulativeState string) (newQVersionId *uuid.UUID, err error)
ChangeDatasetCumulativeState uses a Metax RPC call to change cumulative_state for a dataset with the given Metax identifier. The updated dataset is fetched from Metax and it replaces the current version in the DB, so any unpublished changes are lost. If a new dataset version was created, returns the new Qvain identifier.
func FetchDataset ¶ added in v0.10.3
func FetchDataset(api *metax.MetaxService, db *psql.DB, logger zerolog.Logger, uid uuid.UUID, metaxIdentifier string) (*uuid.UUID, error)
FetchDataset syncs a dataset from Metax and returns its Qvain identifier.
func FetchSince ¶
func Publish ¶
func Publish(api *metax.MetaxService, db *psql.DB, id uuid.UUID, owner *models.User) (versionId string, newVersionId string, newQVersionId *uuid.UUID, err error)
Publish stores a dataset in Metax and updates the Qvain database. It returns the Metax identifier for the dataset, the new version idenifier if such was created, and an error. The error returned can be a Metax ApiError, a Qvain database error, or a basic Go error.
func RefreshDatasetDirectoryContent ¶ added in v0.10.3
func RefreshDatasetDirectoryContent(api *metax.MetaxService, db *psql.DB, logger *zerolog.Logger, owner *models.User, id uuid.UUID, directoryIdentifier string) (newQVersionId *uuid.UUID, err error)
RefreshDatasetDirectoryContent uses a Metax RPC call to update directory contents for a directory in a dataset with the given Metax identifier. The updated dataset is fetched from Metax and it replaces the current version in the DB, so any unpublished changes are lost. If a new dataset version was created, returns the new Qvain identifier.
func UnpublishAndDelete ¶
UnpublishAndDelete marks a dataset as removed in Metax and deletes it from the Qvain db. The dataset will no longer be visible in Metax queries unless the ?removed=true parameter is used.
Types ¶
This section is empty.