datastore

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Copyright 2017 Elliott Polk. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

View Source
const Bucket string = "configs"

Variables

This section is empty.

Functions

func Get

func Get(key string) string

Get retrieves the relevant content for the provided key.

func GetKeys

func GetKeys() []string

GetKeys iterates over the available keys and returns them as a list.

func Key

func Key(values ...string) string

func Remove

func Remove(key string) error

Remove deletes the content for the provided key. No error is returned if the provided key does not exist.

func Set

func Set(key, value string) error

Set adds a new entry into the key/value store. If the key exists, the old value will be overwritten.

Types

type Datastore

type Datastore struct {
	*bolt.DB
	// contains filtered or unexported fields
}

func Current

func Current() *Datastore

func Open

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

func (*Datastore) Close

func (ds *Datastore) Close(rm bool) error

func (*Datastore) Open

func (ds *Datastore) Open() error

Start will open a bolt key / value. If the datastore does not currently exist, a new one will be generated. It will also create the relevant bucket for storage if it does not exist.

Jump to

Keyboard shortcuts

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