db

package
v0.0.0-...-aef646c Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Buckets is a slice of top level buckets for the database.

Functions

This section is empty.

Types

type Bolt

type Bolt struct {
	*bolt.DB
	Filename string
}

Bolt is a container for a bolt database

func (*Bolt) ClientIDs

func (b *Bolt) ClientIDs() ([]string, error)

ClientIDs returns all NodeIDs within the database.

func (*Bolt) Clients

func (b *Bolt) Clients() ([]*conf.Client, error)

Clients returns all the Nodes within the database.

func (*Bolt) Close

func (b *Bolt) Close() error

Close the database if it's open.

func (*Bolt) CreateBuckets

func (b *Bolt) CreateBuckets() error

CreateBuckets creates the buckets for margo.

func (*Bolt) GetClient

func (b *Bolt) GetClient(id []byte) (c *conf.Client, err error)

func (*Bolt) Open

func (b *Bolt) Open(name string) error

Open opens a bolt database.

func (*Bolt) SaveClient

func (b *Bolt) SaveClient(c *conf.Client) error

SaveClient saves a Node in the client bucket.

type Bucket

type Bucket int
const (
	Invalid Bucket = iota
	Client
	Role
	Group
	Cluster
	Datacenter
)

func BucketFromString

func BucketFromString(s string) Bucket

BucketFromString returns the Bucket for a given string, or Invalid for anything that does not match. All input strings are normalized to lower.

func (Bucket) String

func (i Bucket) String() string

type Error

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

Error is an error struct for database operations

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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