Documentation ¶
Index ¶
- Constants
- func WriteHeader(w io.Writer, h Header) error
- type Header
- type IndexHeader
- type IndexMode
- type NSInfo
- type ZDBPool
- func (p *ZDBPool) Create(name, password string, size uint64) error
- func (p *ZDBPool) Exists(name string) bool
- func (p *ZDBPool) IndexMode(name string) (mode IndexMode, err error)
- func (p *ZDBPool) Namespace(name string) (info NSInfo, err error)
- func (p *ZDBPool) Namespaces() ([]NSInfo, error)
- func (p *ZDBPool) Reserved() (uint64, error)
Constants ¶
const Prefix = "zdb"
Prefix is a string used as prefix in the filesystem volume used to storge 0-db namespaces
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IndexHeader ¶
type IndexHeader struct { Magic [4]byte // four bytes magic bytes to recognize the file Version uint32 // file version, for possible upgrade compatibility Created uint64 // unix timestamp of creation time Opened uint64 // unix timestamp of last opened time Fileid uint16 // current index file id (sync with dataid) Mode IndexMode // running mode when index was create }
IndexHeader is the structure contains information about an index adapted from https://github.com/threefoldtech/0-db/blob/development/libzdb/index.h#L31
type IndexMode ¶
type IndexMode uint8
IndexMode represens the mode in which the 0-db is running Adapted from https://github.com/threefoldtech/0-db/blob/development/libzdb/index.h#L4
type ZDBPool ¶
type ZDBPool struct {
// contains filtered or unexported fields
}
ZDBPool represent a part of a disk that is reserved to store 0-db data
func (*ZDBPool) Create ¶
Create a namespace. Note that this create only reserve the name space size (and create namespace descriptor) this must be followed by an actual zdb NSNEW call to create the database files.
func (*ZDBPool) Exists ¶
Exists checks if a namespace exists in the pool or not this method is way faster then using Namespaces cause it doesn't have to read any data
func (*ZDBPool) Namespaces ¶
Namespaces returns a list of NSinfo of all the namespace present in the pool