boltclient

package
v0.0.0-...-14b48b0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PairBucket = "pairs"
View Source
const UserBucket = "giftees"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a client connection to a bolt database

func NewClient

func NewClient(path string, bucket ...string) *Client

NewClient takes a path string and returns a new `Client` to that database

func (*Client) CleanDatabase

func (c *Client) CleanDatabase() error

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection

func (*Client) GetMatches

func (c *Client) GetMatches() ([]match.Pair, error)

GetMatches retrieves the list of Pairs from the database

func (*Client) GetPair

func (c *Client) GetPair(key string) (*match.Pair, error)

GetPair retrieves a single Pair from the database

func (*Client) GetUser

func (c *Client) GetUser(key string) (*csv.User, error)

GetUser retrieves a single User from the database

func (*Client) GetUserList

func (c *Client) GetUserList() ([]csv.User, error)

GetUserList retrieves the list of Users from the database

func (*Client) Open

func (c *Client) Open() error

Open opens a new bolt database and initializes the `buckets`

func (*Client) SetBucket

func (c *Client) SetBucket(buckets ...string)

SetBucket registers a bucket (or multiple) with the client

func (*Client) StoreMatches

func (c *Client) StoreMatches(pl ...match.Pair) error

StoreMatches saves Pair data to the database. `pl` can be single or multiple Pair(s)

func (*Client) StoreUsers

func (c *Client) StoreUsers(ul ...csv.User) error

StoreUsers saves User data to the database. `ul` can be single or multiple User(s)

Jump to

Keyboard shortcuts

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