postgreskv

package
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: AGPL-3.0 Imports: 13 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 Client

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

Client is the entrypoint into a postgreskv data store.

func NewWith added in v0.30.4

func NewWith(db tagsql.DB, dbURL string) *Client

NewWith instantiates a new postgreskv client given db.

func Open added in v1.17.1

func Open(ctx context.Context, dbURL string, app string) (*Client, error)

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

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

Delete deletes the given key and its associated value.

func (*Client) DeleteMultiple added in v0.33.2

func (client *Client) DeleteMultiple(ctx context.Context, keys []storage.Key) (_ storage.Items, err error)

DeleteMultiple deletes keys ignoring missing keys.

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 LookupLimit). If more keys are provided than the maximum, an error will be returned.

func (*Client) Iterate

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

Iterate calls the callback with an iterator over the keys.

func (*Client) IterateWithoutLookupLimit added in v1.4.1

func (client *Client) IterateWithoutLookupLimit(ctx context.Context, opts storage.IterateOptions, fn func(context.Context, storage.Iterator) error) (err error)

IterateWithoutLookupLimit calls the callback with an iterator over the keys, but doesn't enforce default limit 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) LookupLimit added in v0.31.0

func (client *Client) LookupLimit() int

LookupLimit returns the maximum limit that is allowed.

func (*Client) MigrateToLatest added in v1.4.1

func (client *Client) MigrateToLatest(ctx context.Context) error

MigrateToLatest migrates to latest schema version.

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) SetLookupLimit added in v0.31.0

func (client *Client) SetLookupLimit(v int)

SetLookupLimit sets the lookup limit.

Directories

Path Synopsis
Code generated for package schema by go-bindata DO NOT EDIT.
Code generated for package schema by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

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