db

package
v0.0.0-...-163fc3c Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB(args ...interface{}) (db.DB, error)

func OpenDB

func OpenDB(args ...interface{}) (db.DB, error)

Types

type LDBBucket

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

LDBBucket ...

func (*LDBBucket) Bucket

func (b *LDBBucket) Bucket(name string) db.Bucket

Bucket ...

func (*LDBBucket) BucketNames

func (b *LDBBucket) BucketNames() (names []string, err error)

BucketNames ...

func (*LDBBucket) Clear

func (b *LDBBucket) Clear() error

Clear ...

func (*LDBBucket) Close

func (b *LDBBucket) Close() error

Close ...

func (*LDBBucket) Delete

func (b *LDBBucket) Delete(key []byte) error

Delete ...

func (*LDBBucket) DeleteBucket

func (b *LDBBucket) DeleteBucket(name string) error

DeleteBucket ...

func (*LDBBucket) Get

func (b *LDBBucket) Get(key []byte) ([]byte, error)

Get ...

func (*LDBBucket) GetBucketMeta

func (b *LDBBucket) GetBucketMeta() db.BucketMeta

GetBucketMeta ...

func (*LDBBucket) GetByPrefix

func (b *LDBBucket) GetByPrefix(prefix []byte) ([]*db.Entry, error)

GetByPrefix ...

func (*LDBBucket) NewBucket

func (b *LDBBucket) NewBucket(name string) (db.Bucket, error)

NewBucket create sub bucket

func (*LDBBucket) Put

func (b *LDBBucket) Put(key, value []byte) error

Put ...

type LDBBucketMeta

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

LDBBucketMeta ...

func (*LDBBucketMeta) Depth

func (m *LDBBucketMeta) Depth() int

Depth ...

func (*LDBBucketMeta) Name

func (m *LDBBucketMeta) Name() string

Name ...

func (*LDBBucketMeta) Paths

func (m *LDBBucketMeta) Paths() []string

Paths ...

type LDBReadBucket

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

func (*LDBReadBucket) Bucket

func (b *LDBReadBucket) Bucket(name string) db.Bucket

func (*LDBReadBucket) BucketNames

func (b *LDBReadBucket) BucketNames() (names []string, err error)

func (*LDBReadBucket) Clear

func (b *LDBReadBucket) Clear() error

func (*LDBReadBucket) Delete

func (b *LDBReadBucket) Delete(key []byte) error

func (*LDBReadBucket) DeleteBucket

func (b *LDBReadBucket) DeleteBucket(name string) error

func (*LDBReadBucket) Get

func (b *LDBReadBucket) Get(key []byte) ([]byte, error)

func (*LDBReadBucket) GetBucketMeta

func (b *LDBReadBucket) GetBucketMeta() db.BucketMeta

func (*LDBReadBucket) GetByPrefix

func (b *LDBReadBucket) GetByPrefix(prefix []byte) ([]*db.Entry, error)

func (*LDBReadBucket) NewBucket

func (b *LDBReadBucket) NewBucket(name string) (db.Bucket, error)

func (*LDBReadBucket) Put

func (b *LDBReadBucket) Put(key, value []byte) error

type LDBReadTransaction

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

func (*LDBReadTransaction) BucketNames

func (tx *LDBReadTransaction) BucketNames() (names []string, err error)

func (*LDBReadTransaction) FetchBucket

func (tx *LDBReadTransaction) FetchBucket(meta db.BucketMeta) db.Bucket

func (*LDBReadTransaction) Rollback

func (tx *LDBReadTransaction) Rollback() error

Rollback ...

func (*LDBReadTransaction) TopLevelBucket

func (tx *LDBReadTransaction) TopLevelBucket(name string) db.Bucket

type LDBTransaction

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

LDBTransaction ...

func (*LDBTransaction) BucketNames

func (tx *LDBTransaction) BucketNames() (names []string, err error)

BucketNames ...

func (*LDBTransaction) Commit

func (tx *LDBTransaction) Commit() error

Commit ...

func (*LDBTransaction) CreateTopLevelBucket

func (tx *LDBTransaction) CreateTopLevelBucket(name string) (db.Bucket, error)

CreateTopLevelBucket ...

func (*LDBTransaction) DeleteTopLevelBucket

func (tx *LDBTransaction) DeleteTopLevelBucket(name string) error

DeleteTopLevelBucket ...

func (*LDBTransaction) FetchBucket

func (tx *LDBTransaction) FetchBucket(meta db.BucketMeta) db.Bucket

FetchBucket ...

func (*LDBTransaction) Rollback

func (tx *LDBTransaction) Rollback() error

Rollback ...

func (*LDBTransaction) TopLevelBucket

func (tx *LDBTransaction) TopLevelBucket(name string) db.Bucket

TopLevelBucket ...

type LevelDB

type LevelDB struct {
	LDb *leveldb.DB
}

LevelDB ...

func (*LevelDB) BeginReadTx

func (l *LevelDB) BeginReadTx() (db.ReadTransaction, error)

only read BeginReadTx ...

func (*LevelDB) BeginTx

func (l *LevelDB) BeginTx() (db.DBTransaction, error)

BeginTx ...

func (*LevelDB) Close

func (l *LevelDB) Close() error

Close It is not safe to close a DB until all outstanding iterators are released.

Jump to

Keyboard shortcuts

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