sweetdb

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMetaNotFound = fmt.Errorf("unable to locate meta information")
)

Functions

This section is empty.

Types

type DB

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

DB is the primary data store of the sweet daemon.

func Open

func Open(dbPath string) (*DB, error)

Open opens an existing sweetdb.

func (*DB) FetchMeta

func (d *DB) FetchMeta(tx *bolt.Tx) (*Meta, error)

FetchMeta fetches the meta data from boltdb and returns filled meta structure.

func (*DB) GetBuzzOnDispense added in v0.4.0

func (db *DB) GetBuzzOnDispense() (bool, error)

func (*DB) GetDispenseOnTouch added in v0.4.0

func (db *DB) GetDispenseOnTouch() (bool, error)

func (*DB) GetLightningNode

func (db *DB) GetLightningNode() (*LightningNode, error)

func (*DB) GetName added in v0.4.0

func (db *DB) GetName() (string, error)

func (*DB) GetWifiConnection added in v0.4.8

func (db *DB) GetWifiConnection() (*WifiConnection, error)

func (*DB) Path

func (d *DB) Path() string

Path returns the file path to the channel database.

func (*DB) PutMeta

func (d *DB) PutMeta(meta *Meta) error

PutMeta writes the passed instance of the database met-data struct to disk.

func (*DB) SetBuzzOnDispense added in v0.4.0

func (db *DB) SetBuzzOnDispense(buzzOnDispense bool) error

func (*DB) SetDispenseOnTouch added in v0.4.0

func (db *DB) SetDispenseOnTouch(dispenseOnTouch bool) error

func (*DB) SetLightningNode

func (db *DB) SetLightningNode(lightningNode *LightningNode) error

func (*DB) SetName added in v0.4.0

func (db *DB) SetName(name string) error

func (*DB) SetWifiConnection added in v0.4.8

func (db *DB) SetWifiConnection(wifiConnection *WifiConnection) error

func (*DB) Wipe

func (d *DB) Wipe() error

Wipe completely deletes all saved state within all used buckets within the database. The deletion is done in a single transaction, therefore this operation is fully atomic.

type LightningNode

type LightningNode struct {
	Uri      string `json:"uri"`
	Cert     []byte `json:"cert"`
	Macaroon []byte `json:"macaroon"`
}

type Meta

type Meta struct {
	// DbVersionNumber is the current schema version of the database.
	DbVersionNumber uint32
}

Meta structure holds the database meta information.

type WifiConnection added in v0.4.8

type WifiConnection struct {
	Ssid string `json:ssid`
	Psk  string `json:psk`
}

Jump to

Keyboard shortcuts

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