Documentation
¶
Overview ¶
Package datastore provides a repository implementation.
Index ¶
- type Context
- func (ctx *Context) Add(collection string, data interface{}) error
- func (ctx *Context) Commit() error
- func (ctx *Context) Remove(collection string, filter client.Filter, first int) (int, error)
- func (ctx *Context) Rollback() error
- func (ctx *Context) Update(collection string, filter client.Filter, data interface{}) (int, error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶ added in v0.0.9
Context is a data store transactions
func NewContext ¶ added in v0.0.9
func NewContext(ctx context.Context, repo *Repository) (*Context, error)
NewContext creates a new instance of the data store context
func (*Context) Remove ¶ added in v0.0.9
Remove removes items from the repository matching criteria.
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) Context ¶ added in v0.0.9
func (r *Repository) Context(ctx context.Context) (*Context, error)
Context creates a new data store context
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) Search ¶ added in v0.0.2
Search retrieves items from the repository matching criteria.
func (*Repository) Tag ¶ added in v0.0.6
func (r *Repository) Tag(tag string) *Repository
Tag sets the tag for adding to repository
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.