Documentation
¶
Index ¶
- func New() stores.Interface
- type Store
- func (st *Store) Create(obj *usher.Object) *usher.Error
- func (st *Store) Delete(obj *usher.Object, id usher.ObjectID) *usher.Error
- func (st *Store) Exists(id usher.ObjectID) *usher.Error
- func (st *Store) Get(obj *usher.Object, id usher.ObjectID) *usher.Error
- func (st *Store) GetAll(obj *[]usher.Object, kind string, qa ...interface{}) *usher.Error
- func (st *Store) GetLatest(obj *usher.Object, kind string, qa ...interface{}) *usher.Error
- func (st *Store) Update(obj *usher.Object, id usher.ObjectID, updates []usher.UpdateClause) *usher.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the 'stores.Interface'.
func (*Store) Create ¶
Create stores the object into the storage backend. If object with same ID already exists, a '409 Conflict' error is returned.
func (*Store) Delete ¶
Delete will delete the object identified by (name, kind, parent). If item does not exist matching the given query, '404 NotFound' will be returned.
func (*Store) Get ¶
Get will fetch first object that matches the (name, kind, parent) ID tuple. If no object found matching this tuple, '404 NotFound' will be returned.
func (*Store) GetAll ¶
GetAll will fetch all the objects of the given 'kind'. Also, additional queries can be provided as variadic arguments. If no item found matching the (kind, query), the pointer 'obj' to list will not be modified.
func (*Store) Update ¶
func (st *Store) Update(obj *usher.Object, id usher.ObjectID, updates []usher.UpdateClause) *usher.Error
Update is used to update an object. Update selectively updates and hence can be used for both PUT and PATCH type implementations. Only changes that are provided through in 'updates' array are applied to the object. If item does not exist in memory, a '404 NotFound' will be returned.