table

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateCaches

func MigrateCaches(c interface{}, get func() interface{})

MigrateCaches sets target fields to get() result.

func MigrateTables

func MigrateTables(s interface{}, db kvdb.Store)

MigrateTables sets target fields to database tables.

Types

type Readonly

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

Readonly table wraper of the underling DB, so all the table's data is stored with a prefix in underling DB.

func NewReadonly

func NewReadonly(db kvdb.ReadonlyStore, prefix []byte) *Readonly

func (*Readonly) Get

func (t *Readonly) Get(key []byte) ([]byte, error)

func (*Readonly) Has

func (t *Readonly) Has(key []byte) (bool, error)

func (*Readonly) NewIterator

func (t *Readonly) NewIterator(itPrefix []byte, start []byte) kvdb.Iterator

func (*Readonly) NewReadonlyTable

func (t *Readonly) NewReadonlyTable(prefix []byte) *Readonly

func (*Readonly) Stat

func (t *Readonly) Stat(property string) (string, error)

type Table

type Table struct {
	Readonly
	// contains filtered or unexported fields
}

Table wraper the underling DB, so all the table's data is stored with a prefix in underling DB

func New

func New(db kvdb.Store, prefix []byte) *Table

func (*Table) Close

func (t *Table) Close() error

func (*Table) Compact

func (t *Table) Compact(start []byte, limit []byte) error

func (*Table) Delete

func (t *Table) Delete(key []byte) error

func (*Table) Drop

func (t *Table) Drop()

Drop the whole database.

func (*Table) NewBatch

func (t *Table) NewBatch() kvdb.Batch

func (*Table) NewTable

func (t *Table) NewTable(prefix []byte) *Table

func (*Table) Put

func (t *Table) Put(key []byte, value []byte) error

Jump to

Keyboard shortcuts

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