postgreskv

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2019 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

func (*AlternateClient) Iterate

func (altClient *AlternateClient) Iterate(ctx context.Context, opts storage.IterateOptions, fn func(context.Context, storage.Iterator) error) (err error)

Iterate iterates over items based on opts

type Client

type Client struct {
	URL string
	// contains filtered or unexported fields
}

Client is the entrypoint into a postgreskv data store

func New

func New(dbURL string) (*Client, error)

New instantiates a new postgreskv client given db URL

func (*Client) Close

func (client *Client) Close() error

Close closes the client

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) Delete

func (client *Client) Delete(ctx context.Context, key storage.Key) (err error)

Delete deletes the given key and its associated value.

func (*Client) DeletePath

func (client *Client) DeletePath(ctx context.Context, bucket, key storage.Key) (err error)

DeletePath deletes the given key (in the given bucket) and its associated value.

func (*Client) Get

func (client *Client) Get(ctx context.Context, key storage.Key) (_ storage.Value, err error)

Get looks up the provided key and returns its value (or an error).

func (*Client) GetAll

func (client *Client) GetAll(ctx context.Context, keys storage.Keys) (_ storage.Values, err error)

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.

func (*Client) Put

func (client *Client) Put(ctx context.Context, key storage.Key, value storage.Value) (err error)

Put sets the value for the provided key.

func (*Client) PutPath

func (client *Client) PutPath(ctx context.Context, bucket, key storage.Key, value storage.Value) (err error)

PutPath sets the value for the provided key (in the given bucket).

Directories

Path Synopsis
Code generated by go-bindata.
Code generated by go-bindata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL