Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileExist = errors.New("file exist") ErrFileNotExist = errors.New("file not exist") ErrBucketExist = errors.New("bucket already exist") ErrBucketNotFound = errors.New("bucket not found") ErrInvalidBucketName = errors.New("invalid bucket name") ErrIllegalKey = errors.New("illegal key") ErrIllegalValue = errors.New("illegal value") ErrNotSupported = errors.New("not supported") ErrIllegalBucketPath = errors.New("illegal bucket path") ErrInvalidArgument = errors.New("invalid argument") ErrWriteNotAllowed = errors.New("write not allowed") ErrDbUnknownType = errors.New("unknownt db type") ErrOpenDBFailed = errors.New("open db failed") ErrCreateDBFailed = errors.New("create db failed") )
Error definition
Functions ¶
func RegisterDriver ¶
func RegisterDriver(ins DBDriver)
func RegisteredDbTypes ¶
func RegisteredDbTypes() []string
Types ¶
type Bucket ¶
type Bucket interface { NewBucket(name string) (Bucket, error) Bucket(name string) Bucket BucketNames() ([]string, error) DeleteBucket(name string) error Put(key, value []byte) error Delete(key []byte) error Get(key []byte) ([]byte, error) Clear() error GetByPrefix([]byte) ([]*Entry, error) GetBucketMeta() BucketMeta }
Bucket ...
func GetOrCreateBucket ¶
GetOrCreateBucket return a sub store space(sub Bucket). Param db can also be a Bucket instance
func GetOrCreateTopLevelBucket ¶
func GetOrCreateTopLevelBucket(tx DBTransaction, name string) (b Bucket, err error)
GetOrCreateTopLevelBucket ...
type BucketMeta ¶
BucketMeta ...
type DB ¶
type DB interface { Close() error BeginTx() (DBTransaction, error) BeginReadTx() (ReadTransaction, error) }
DB ...
type DBTransaction ¶
type DBTransaction interface { Commit() error Rollback() error TopLevelBucket(name string) Bucket BucketNames() ([]string, error) FetchBucket(meta BucketMeta) Bucket CreateTopLevelBucket(name string) (Bucket, error) DeleteTopLevelBucket(name string) error }
DBTransaction ...
type ReadTransaction ¶
Click to show internal directories.
Click to hide internal directories.