Documentation ¶
Index ¶
- Variables
- type AlternateClient
- type Client
- func (client *Client) Close() error
- func (client *Client) CompareAndSwap(ctx context.Context, key storage.Key, oldValue, newValue storage.Value) (err error)
- func (client *Client) CompareAndSwapPath(ctx context.Context, bucket, key storage.Key, oldValue, newValue storage.Value) (err error)
- func (client *Client) Delete(ctx context.Context, key storage.Key) (err error)
- func (client *Client) DeletePath(ctx context.Context, bucket, key storage.Key) (err error)
- func (client *Client) Get(ctx context.Context, key storage.Key) (_ storage.Value, err error)
- func (client *Client) GetAll(ctx context.Context, keys storage.Keys) (_ storage.Values, err error)
- func (client *Client) GetAllPath(ctx context.Context, bucket storage.Key, keys storage.Keys) (_ storage.Values, err error)
- func (client *Client) GetPath(ctx context.Context, bucket, key storage.Key) (_ storage.Value, err error)
- func (client *Client) Iterate(ctx context.Context, opts storage.IterateOptions, ...) (err error)
- func (client *Client) List(ctx context.Context, first storage.Key, limit int) (_ storage.Keys, err error)
- func (client *Client) Put(ctx context.Context, key storage.Key, value storage.Value) (err error)
- func (client *Client) PutPath(ctx context.Context, bucket, key storage.Key, value storage.Value) (err error)
Constants ¶
This section is empty.
Variables ¶
var Error = errs.Class("postgreskv error")
Error is the default postgreskv errs class
Functions ¶
This section is empty.
Types ¶
type AlternateClient ¶
type AlternateClient struct {
*Client
}
AlternateClient is the entrypoint into an alternate postgreskv data store
func AltNew ¶
func AltNew(dbURL string) (*AlternateClient, error)
AltNew instantiates a new postgreskv AlternateClient given db URL
func (*AlternateClient) Close ¶
func (altClient *AlternateClient) Close() error
Close closes an AlternateClient and frees its resources.
type Client ¶
type Client struct { URL string // contains filtered or unexported fields }
Client is the entrypoint into a postgreskv data store
func (*Client) CompareAndSwap ¶ added in v0.16.0
func (client *Client) CompareAndSwap(ctx context.Context, key storage.Key, oldValue, newValue storage.Value) (err error)
CompareAndSwap atomically compares and swaps oldValue with newValue
func (*Client) CompareAndSwapPath ¶ added in v0.16.0
func (client *Client) CompareAndSwapPath(ctx context.Context, bucket, key storage.Key, oldValue, newValue storage.Value) (err error)
CompareAndSwapPath atomically compares and swaps oldValue with newValue in the given bucket
func (*Client) DeletePath ¶
DeletePath deletes the given key (in the given bucket) and its associated value.
func (*Client) GetAll ¶
GetAll finds all values for the provided keys (up to storage.LookupLimit). If more keys are provided than the maximum, an error will be returned.
func (*Client) GetAllPath ¶
func (client *Client) GetAllPath(ctx context.Context, bucket storage.Key, keys storage.Keys) (_ storage.Values, err error)
GetAllPath finds all values for the provided keys (up to storage.LookupLimit) in the given bucket. if more keys are provided than the maximum, an error will be returned.
func (*Client) GetPath ¶
func (client *Client) GetPath(ctx context.Context, bucket, key storage.Key) (_ storage.Value, err error)
GetPath looks up the provided key (in the given bucket) and returns its value (or an error).
func (*Client) Iterate ¶
func (client *Client) Iterate(ctx context.Context, opts storage.IterateOptions, fn func(context.Context, storage.Iterator) error) (err error)
Iterate iterates over items based on opts
func (*Client) List ¶
func (client *Client) List(ctx context.Context, first storage.Key, limit int) (_ storage.Keys, err error)
List returns either a list of known keys, in order, or an error.