db

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package db provides persistent storage and caching of values returned from the registry. Sensitive data is stored in the db in its encrypted form.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is a persistent store for encrypted or non-sensitvie values.

func NewDB

func NewDB(path string) (*DB, error)

NewDB creates a new db or opens an existing db at the given path. If the db already exists but has a mismatched version, it will be cleared before being returned.

func (*DB) Close

func (db *DB) Close() error

Close closes all db resources

func (*DB) Get

func (db *DB) Get(id *identity.ID, env envelope.Envelope) error

Get returns the value of id in env. It returns an error if id does not exist.

func (*DB) Set

func (db *DB) Set(envs ...envelope.Envelope) error

Set stores the serialized value of env into the db, under key id. Stored values are grouped by their type.

Jump to

Keyboard shortcuts

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