Documentation ¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) Delete(ctx context.Context, q *Query) error
- func (c *Client) Get(ctx context.Context, k *Key, v interface{}) error
- func (c *Client) IsNotFound(err error) bool
- func (c *Client) NewKey(kind, name string) *Key
- func (c *Client) NewQuery(kind string) *Query
- func (c *Client) PutDocument(ctx context.Context, r *models.Document) error
- func (c *Client) Raw(ctx context.Context, target RawRows, sql string, values ...interface{}) error
- func (c *Client) Run(ctx context.Context, q *Query) *Iterator
- type Iterator
- type Key
- type Query
- type RawRows
- type Requirement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connection to a storage provider.
func NewClient ¶
NewClient creates a new database session using the provided driver and data source name. Driver must be one of [ postgres, cloudsqlpostgres ]. DSN format varies per database driver.
PostgreSQL DSN Reference: See "Connection Strings" at https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING SQLite DSN Reference: See "URI filename examples" at https://www.sqlite.org/c3ref/open.html
func (*Client) IsNotFound ¶
IsNotFound returns true if an error is due to an entity not being found.
func (*Client) PutDocument ¶
Put puts an entity using the storage client.
type Iterator ¶
Iterator can be used to iterate through results of a query.
type Query ¶
type Query struct { Kind string Offset int Order string Requirements []*Requirement }
Query represents a query in a storage provider.
func (*Query) ApplyOffset ¶
func (*Query) Descending ¶
type Requirement ¶
type Requirement struct { Name string Value interface{} }
Requirement adds an equality filter to a query.