Documentation
¶
Overview ¶
Package repository provides a collection like object for persistence.
Index ¶
- type Repository
- func (r *Repository) Add(ctx context.Context, collection string, items ...datastore.Snapper) error
- func (r *Repository) Filter() datastore.Filter
- func (r *Repository) Query() datastore.Query
- func (r *Repository) Remove(ctx context.Context, collection string, filter datastore.Filter, first int) (int, error)
- func (r *Repository) Search(ctx context.Context, query datastore.Query) (datastore.Cursor, error)
- func (r *Repository) Update(ctx context.Context, collection string, filter datastore.Filter, ...) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is an instance of a postgres Database
func New ¶
func New(client datastore.Client) (*Repository, error)
New creates a new postgres database
func (*Repository) Filter ¶
func (r *Repository) Filter() datastore.Filter
Filter gets a new filter for searching the repository.
func (*Repository) Query ¶
func (r *Repository) Query() datastore.Query
Query gets a new query for searching the repository.
func (*Repository) Remove ¶
func (r *Repository) Remove(ctx context.Context, collection string, filter datastore.Filter, first int) (int, error)
Remove removes items from the repository matching criteria.
Click to show internal directories.
Click to hide internal directories.