Documentation
¶
Overview ¶
Package datastore provides a repository implementation.
Index ¶
- type Repository
- func (r *Repository) Add(ctx context.Context, collection string, items ...client.Snapper) error
- func (r *Repository) Filter() client.Filter
- func (r *Repository) Query() client.Query
- func (r *Repository) Remove(ctx context.Context, collection string, filter client.Filter, first int) (int, error)
- func (r *Repository) Search(ctx context.Context, query client.Query) (client.Cursor, error)
- func (r *Repository) Update(ctx context.Context, collection string, filter client.Filter, ...) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶ added in v0.0.2
type Repository struct {
// contains filtered or unexported fields
}
Repository is an instance of a postgres Database
func New ¶ added in v0.0.2
func New(client client.Client) (*Repository, error)
New creates a new postgres database
func (*Repository) Filter ¶ added in v0.0.2
func (r *Repository) Filter() client.Filter
Filter gets a new filter for searching the repository.
func (*Repository) Query ¶ added in v0.0.2
func (r *Repository) Query() client.Query
Query gets a new query for searching the repository.
func (*Repository) Remove ¶ added in v0.0.2
func (r *Repository) Remove(ctx context.Context, collection string, filter client.Filter, first int) (int, error)
Remove removes items from the repository matching criteria.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client provides resources for data persistence and retrieval.
|
Package client provides resources for data persistence and retrieval. |
|
Package internal provides our internal API resources.
|
Package internal provides our internal API resources. |
|
mock
Package mock provides a basic mock for testing the datastore.
|
Package mock provides a basic mock for testing the datastore. |
|
Package postgres provides a store implementation using Postgres.
|
Package postgres provides a store implementation using Postgres. |
|
integration
Package integration provides resources for doing integration testing.
|
Package integration provides resources for doing integration testing. |
Click to show internal directories.
Click to hide internal directories.