db

package
v0.0.0-...-4396624 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2018 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRecord

func AddRecord(tx *bolt.Tx, r Record) error

AddRecord function adds records to BoltDB

func OpenDB

func OpenDB(filename string, permission os.FileMode, readOnly bool) (*bolt.DB, error)

OpenDB is a public function used to open the Database

Types

type Item

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

func (*Item) BucketName

func (item *Item) BucketName() string

func (*Item) Create

func (item *Item) Create(bdb *bolt.DB) error

func (*Item) Find

func (item *Item) Find(bdb *bolt.DB, id string) (interface{}, error)

Find is a public function for finding staged APIs

func (*Item) Group

func (item *Item) Group() string

func (*Item) Id

func (item *Item) Id() string

func (*Item) Name

func (item *Item) Name() string

func (*Item) RecordData

func (item *Item) RecordData() interface{}

type Record

type Record interface {
	Id() string
	Name() string
	BucketName() string
	Group() string
	RecordData() interface{}
	Create(bdb *bolt.DB) error
	Find(bdb *bolt.DB, id string) (interface{}, error)
}

Record interface for all objects in the DB

Jump to

Keyboard shortcuts

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