database

package
v0.0.0-...-61cbdb0 Latest Latest
Warning

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

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

Documentation

Overview

Package database handles all communication between software and the database

Index

Constants

View Source
const (
	BUCKET_USERS = "users"
	BUCKET_PORTS = "ports"
)

Bucket constants

View Source
const (
	DB_MAIN = "datastore.db"
)

Database constants

Variables

View Source
var (
	ErrKeyNotExist = errors.New("key does not exist")
)

Error codes

Functions

This section is empty.

Types

type Datastore

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

func Open

func Open(filepath string) (*Datastore, error)

Open function will open the database and return a Datastore struct that has a handle within it for various datastore functions.

func (*Datastore) Close

func (ds *Datastore) Close() error

Close is a function attached to the Datastore struct that will close the current bolt instance

func (*Datastore) Delete

func (ds *Datastore) Delete(bucket string, key []byte) error

Delete is a function attached to the Datastore struct that will delete data from the current bolt instance

func (*Datastore) Get

func (ds *Datastore) Get(bucket string, key []byte, result interface{}) error

Get is a function attached to the Datastore struct that will get data from the current bolt instance

func (*Datastore) Put

func (ds *Datastore) Put(bucket string, key []byte, value interface{}) error

Put is a function attached to the Datastore struct that will put data into the current bolt instance

Jump to

Keyboard shortcuts

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