Documentation ¶
Index ¶
- Variables
- func Load(meta Metadata, data interface{}, r io.Reader) error
- func LoadFile(meta Metadata, data interface{}, filename string) error
- func NewSafeFile(filename string) (*safeFile, error)
- func RandomSuffix() string
- func Save(meta Metadata, data interface{}, w io.Writer) error
- func SaveFile(meta Metadata, data interface{}, filename string) error
- type BoltDatabase
- type Metadata
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilEntry = errors.New("entry does not exist") ErrNilBucket = errors.New("bucket does not exist") )
View Source
var ( ErrBadVersion = errors.New("incompatible version") ErrBadHeader = errors.New("wrong header") )
View Source
var NilDB nildb
NilDB is a db whose methods are no-ops. Calls to Block will return the zero value of types.Block. Calls to Height will return 0.
Functions ¶
func NewSafeFile ¶ added in v1.0.0
func RandomSuffix ¶ added in v1.0.0
func RandomSuffix() string
RandomSuffix returns a 20 character base32 suffix for a filename. There are 100 bits of entropy, and a very low probability of colliding with existing files unintentionally.
Types ¶
type BoltDatabase ¶ added in v1.0.0
func OpenDatabase ¶ added in v1.0.0
func OpenDatabase(md Metadata, filename string) (*BoltDatabase, error)
openDatabase opens a database filename and checks metadata
func (*BoltDatabase) CloseDatabase ¶
func (db *BoltDatabase) CloseDatabase() error
CloseDatabase saves the bolt database to a file, and updates metadata
Click to show internal directories.
Click to hide internal directories.