Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrKeyNotFound = badger.ErrKeyNotFound
)
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket interface { // Put saves val by key Put(key, val []byte, opts ...PutOption) error // PutVal saves value and return auto inc id (binary with big endian) // Do not use it with Put func in the same bucket // Items may be overwritten with auto generated key PutVal(val []byte, opts ...PutOption) ([]byte, error) // Get gets val by key Get(key []byte) ([]byte, *Meta, error) // GetAt gets val from offset, it returns num of bytes // It returns io.EOF if no bytes were read GetAt(key, buf []byte, offset int) (int, error) // GetMeta returns meta info // It returns nil, nil when there is no meta GetMeta(key []byte) (*Meta, error) // Exists check if key exists Exists(key []byte) (bool, error) // Delete removes val by key Delete(key []byte) error // Range returns iterator for [beginKey, endKey), all for nil, nil Range(beginKey, endKey []byte, reverse bool) (Iterator, error) // Count returns item count of [beginKey, endKey), all for nil, nil Count(beginKey, endKey []byte) (int, error) }
type DB ¶
type DB interface { // CreateNamespace creates or gets namespace CreateNamespace(name []byte) (Namespace, error) // DeleteNamespace deletes namespace by name and all data in the namespace DeleteNamespace(name []byte) error // Compact do flush and compaction on db Compact() error // Close release db lock Close() error }
type DocIterator ¶
type Meta ¶
type Meta struct { // inputs // mine type: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types Mime string `json:"mime"` // chunk size in bytes, value will split to chunk when it is set ChunkSize int `json:"chunkSize"` // outputs // value len in bytes, it will automatically set TotalLen int `json:"totalLen"` // chunk list keys Chunks []ChunkKey `json:"chunks"` }
type MetaPrefix ¶
type MetaPrefix = byte
type Namespace ¶
type Namespace interface { // DocBucket returns builtin bucket for saving main docs DocBucket() DocBucket // ObjectBucket returns builtin bucket for saving binary resources ObjectBucket() Bucket // CreateBucket creates or gets bucket CreateBucket(name []byte) (Bucket, error) // CreateDocBucket creates or gets doc bucket CreateDocBucket(name []byte) (DocBucket, error) // DeleteBucket deletes bucket by name and all data in the bucket DeleteBucket(name []byte) error // ListBucket gets all user buckets ListBucket() ([]string, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.