Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
Authenticator describes the interface that a service authenticating an HTTP request should implement
type Collection ¶
Collection represents a list of documents
type Document ¶
type Document struct { ID string `json:"id"` CreationDate time.Time `json:"creationDate,omitempty"` LastModificationDate time.Time `json:"lastModificationDate,omitempty"` Properties map[string]interface{} `json:"properties"` }
Document represents a document in a collection
func (Document) GetLastModified ¶
type DocumentProperties ¶
type DocumentProperties map[string]interface{}
DocumentProperties represents the properties of the document
type ObjectRef ¶
type ObjectRef []string
func (ObjectRef) Collection ¶
func (ObjectRef) IsDocument ¶
type Repository ¶
type Repository interface { Init() error Begin() (Transaction, error) }
Repository describes the interface that a datastore should implement
type Transaction ¶
type Transaction interface { Get(document ObjectRef) (Document, error) GetAll(collection ObjectRef, orderBy []string) (Cursor, error) Add(collection ObjectRef, payload DocumentProperties) (Document, error) Put(document ObjectRef, payload DocumentProperties) error Patch(document ObjectRef, payload DocumentProperties) error Delete(document ObjectRef) error DeleteCollection(collection ObjectRef) error Commit() error Rollback() error }
Transaction describes the interface that a datastore transaction should implement
Click to show internal directories.
Click to hide internal directories.