datastore

package
v0.0.0-...-07b9e35 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: OSL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStorer

type DataStorer interface {
	UpsertClipInfo(*contracts.ClipInfo) error

	UpsertEpisodeInfo(*contracts.EpisodeInfo) error

	CreateResearchLease(*uuid.UUID, *contracts.EpisodeInfo, []*contracts.ClipInfo, time.Time) error
	RenewResearchLease(uuid.UUID, time.Time) error
	RevokeResearchLease(uuid.UUID) error

	GetHighestPriorityEpisode() (*contracts.EpisodeInfo, error)
	GetHighestPriorityClipsForEpisode(episode *contracts.EpisodeInfo, limit int) ([]*contracts.ClipInfo, error)
	RecordCompletedResearch(*contracts.CompletedResearchItem) error
}

A DataStorer is anything that is able to store and retrieve data from a persistant data store. Each of the methods of this interface must be implemented as atomic actions. Thus, if an error is returned by any of these methods, the consumer should trust that the underlaying data layer has made all possible attempts to leave the datastore in a safe state. If such a condition cannot be guaranteed, the implementor should expose error types that describe the severity of the issue.

Directories

Path Synopsis
Package adapters contains concrete implementations of database accessors.
Package adapters contains concrete implementations of database accessors.

Jump to

Keyboard shortcuts

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