Documentation
¶
Overview ¶
Package client provides resources for data persistence and retrieval.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Add ¶
type Add interface {
Encoder
To(collection string) Add
Item(value map[string]interface{}) Add
Query(query Query) Add
Execute(ctx context.Context) (int, error)
}
Add represents a command to add items to the collection
type Client ¶
type Client interface {
Connect() error
Filter() Filter
Query() Query
Add() Add
Update() Update
Remove() Remove
Transaction(ctx context.Context) (Transaction, error)
}
Client represents a client for operating on a database.
type Filter ¶
type Filter interface {
Eq(key string, value interface{}) Filter
Lt(key string, value interface{}) Filter
Gt(key string, value interface{}) Filter
NotEq(key string, value interface{}) Filter
BeginsWith(key string, prefix string) Filter
EndsWith(key string, suffix string) Filter
Contains(key string, value interface{}) Filter
NotContains(key string, value interface{}) Filter
Or(another Filter) Filter
And(another Filter) Filter
}
Filter represents criteria for querying the collection
type Query ¶
type Query interface {
Encoder
Secondary() Query
From(collection string) Query
And(collection string, args ...interface{}) Query
Filter(filter Filter) Query
Order(by string) Query
First(first int) Query
After(key string, value *time.Time) Query
Return(key string, args ...interface{}) Query
Execute(ctx context.Context, dst interface{}) error
}
Query represents a query builder
type Remove ¶
type Remove interface {
Encoder
From(collection string) Remove
Filter(filter Filter) Remove
Order(by string) Remove
First(first int) Remove
After(key string, value *time.Time) Remove
Execute(ctx context.Context) (int, error)
}
Remove represents a command to remove items from the collection
Click to show internal directories.
Click to hide internal directories.