Documentation ¶
Index ¶
- func New(url, db, collection string) (storage.Storer, error)
- type Adapter
- func (a *Adapter) Close()
- func (a *Adapter) Create(res *resource.Resource) error
- func (a *Adapter) Delete(resType *core.ResourceType, id, version string) error
- func (a *Adapter) DoGet(resType *core.ResourceType, id, version string, fields map[attr.Path]bool) (*resource.Resource, error)
- func (a *Adapter) DoUpdate(resource *resource.Resource, id, version string) error
- func (a *Adapter) Find(resTypes []*core.ResourceType, filter filter.Filter) (storage.Querier, error)
- func (a *Adapter) Get(resType *core.ResourceType, id, version string, fields map[attr.Path]bool) (*resource.Resource, error)
- func (a *Adapter) Patch(resType *core.ResourceType, id string, version string, op string, ...) error
- func (a *Adapter) Ping() error
- func (a *Adapter) SetIndexes(keys [][]string) error
- func (a *Adapter) Update(resource *resource.Resource, id string, version string) error
- type Driver
- func (d *Driver) Close()
- func (d *Driver) Create(doc *document) error
- func (d *Driver) Delete(query bson.M) error
- func (d *Driver) Find(q bson.M) (*mgo.Query, func(), error)
- func (d *Driver) Patch(id string, query, values bson.M) error
- func (d *Driver) SetIndexes(keys [][]string) (err error)
- func (d *Driver) Update(query bson.M, doc *document) error
- type Iter
- type Query
- func (res *Query) Close()
- func (res *Query) Count() (n int, err error)
- func (res *Query) Fields(fields map[attr.Path]bool) storage.Querier
- func (res *Query) Iter() storage.Iter
- func (res *Query) Limit(n int) storage.Querier
- func (res *Query) Skip(index int) storage.Querier
- func (res *Query) Sort(by attr.Path, asc bool) storage.Querier
- type ResourceNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct { event.Dispatcher // contains filtered or unexported fields }
Adapter is the repository Adapter
func (*Adapter) Close ¶
func (a *Adapter) Close()
Close is the method to explicitly call to close the session
func (*Adapter) Delete ¶
func (a *Adapter) Delete(resType *core.ResourceType, id, version string) error
Delete is ...
func (*Adapter) DoGet ¶
func (a *Adapter) DoGet(resType *core.ResourceType, id, version string, fields map[attr.Path]bool) (*resource.Resource, error)
DoGet is ... Does not emit any event. Is used internally to fetch referenced documents.
func (*Adapter) DoUpdate ¶
DoUpdate is the method that permforms update operations. Does not emit any event. Is used internally to perform update to referenced documents.
func (*Adapter) Find ¶
func (a *Adapter) Find(resTypes []*core.ResourceType, filter filter.Filter) (storage.Querier, error)
Find is ...
func (*Adapter) Get ¶
func (a *Adapter) Get(resType *core.ResourceType, id, version string, fields map[attr.Path]bool) (*resource.Resource, error)
Get is ...
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver repository adaptee
func CreateDriver ¶
CreateDriver factory
func (*Driver) Close ¶
func (d *Driver) Close()
Close is the method to explicitly call to close the session
func (*Driver) SetIndexes ¶
SetIndexes is ...
type Iter ¶
type Iter struct {
// contains filtered or unexported fields
}
Iter is
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is
type ResourceNotFoundError ¶
type ResourceNotFoundError struct {
// contains filtered or unexported fields
}
ResourceNotFoundError is ...
func (ResourceNotFoundError) Error ¶
func (r ResourceNotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.