Documentation
¶
Overview ¶
Package datastore provides a repository implementation.
Index ¶
- func Fields(args ...interface{}) []string
- func Item(in interface{}, transient ...interface{}) (map[string]interface{}, error)
- type Context
- func (ctx *Context) Add(collection string, data interface{}) error
- func (ctx *Context) Commit() error
- func (ctx *Context) Remove(collection string, filter interface{}) (int, error)
- func (ctx *Context) Rollback() error
- func (ctx *Context) Update(collection string, filter, data interface{}) (int, error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fields ¶ added in v0.0.21
func Fields(args ...interface{}) []string
Fields gets all fields for datastore item(s)
func Item ¶ added in v0.0.21
Item converts a struct to a map using reflection variation of: https://play.golang.org/p/2Qi3thFf--
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) Procedure ¶ added in v0.0.18
Procedure executes a series of subroutines and bails fast if any errors occur
func (*Repository) Query ¶ added in v0.0.2
func (r *Repository) Query() client.Query
Query gets a new query for searching the 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.