Documentation ¶
Index ¶
Constants ¶
View Source
const ( // The database driver names that we accept DriverMongo = "mongo" DriverBolt = "bolt" )
Variables ¶
This section is empty.
Functions ¶
func NewCollectionId ¶
func NewCollectionId(in *wyc.Collection) string
Create new collection ID using Parent & Name variables
func NewResourceId ¶
Create new resource ID using parent, name and type
func NewVersionId ¶
Create new version ID using parent & number
Types ¶
type Database ¶
type Database interface { // Given a Version ID, set the Version as "published" // That is, of all versions belonging to the parent Item, the version with // this ID is marked as the published "official" version // - Must: Ensure at most one Version of a given Item is marked as published SetPublished(string) error // Given an Item ID, return the ID of the current PublishedVersion version (if any) Published(string) (*wyc.Version, error) // Insert a collection into the db, return created Id // - Must: Ensure only one collection with given Name InsertCollection(*wyc.Collection) (string, error) // Insert an item into the db, return created Id // - Must: Ensure only one item with the same Collection (parent Id), Type and Variant InsertItem(*wyc.Item) (string, error) // Insert a Version into the db, return created Id // - Must: Ensure version number is both set on the obj & returned. // - Must: Number version numbers starting with 1 // - Must: Ensure there is at most one version of a given number InsertNextVersion(*wyc.Version) (string, int32, error) // Ensure only one version of an Item with a given Number // Insert resource into the db, return created Id InsertResource(*wyc.Resource) (string, error) // Insert link into the db, return created Id InsertLink(*wyc.Link) (string, error) // Retrieve collections indicated by the given Id(s) from the db RetrieveCollection(...string) ([]*wyc.Collection, error) // Retrieve items indicated by the given Id(s) from the db RetrieveItem(...string) ([]*wyc.Item, error) // Retrieve versions indicated by the given Id(s) from the db RetrieveVersion(...string) ([]*wyc.Version, error) // Retrieve resources indicated by the given Id(s) from the db RetrieveResource(...string) ([]*wyc.Resource, error) // Retrieve links indicated by the given Id(s) from the db RetrieveLink(...string) ([]*wyc.Link, error) // Save the updated facets on the given version UpdateItem(string, *wyc.Item) error // Save the updated facets on the given item UpdateVersion(string, *wyc.Version) error // Save the updated facets on the given collection UpdateCollection(string, *wyc.Collection) error // Save the updated facets on the given resource UpdateResource(string, *wyc.Resource) error // Save the updated facets on the given link UpdateLink(string, *wyc.Link) error // Delete collection(s) with the given Id(s) DeleteCollection(...string) error // Delete item(s) with the given Id(s) DeleteItem(...string) error // Delete version(s) with the given Id(s) DeleteVersion(...string) error // Delete resource(s) with the given Id(s) DeleteResource(...string) error // Delete link(s) with the given Id(s) DeleteLink(...string) error // kill connection to db Close() error }
Datastore whose primary goal is long term storage, not searching said data
Click to show internal directories.
Click to hide internal directories.