db

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Instance         *bolt.DB
	Bucket           []byte
	Datafile         string
	CurrentDirectory string
}

func Init

func Init() (d *Database, err error)

Initalize the database and store the instance in the struct.

func (*Database) AddKey

func (d *Database) AddKey(k string, v string) error

Add a new key to the database with a given path.

func (*Database) All

func (d *Database) All() map[string]string

Return all of the tags currently stored in the database with their associated values.

func (*Database) DeleteKey

func (d *Database) DeleteKey(k string) error

Delete a key from the database.

func (*Database) Exists

func (d *Database) Exists(k string) bool

Check if a given key exists in the database.

func (*Database) GetCurrentTags

func (d *Database) GetCurrentTags() []string

Get the current tags that belong to the directory the command is being run in.

func (*Database) GetTags

func (d *Database) GetTags() []string

 Get all of the tags that currently exist in the database.

func (*Database) GetValue

func (d *Database) GetValue(k string) string

Get the value of a specific tag stored in the database.

Jump to

Keyboard shortcuts

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