trie

package
v1.3.11 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigUseKeccak256 = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Immutable

type Immutable interface {
	Empty() bool
	// Get returns the value stored under the specified key, or nil if the key doesn't exist.
	Get(k []byte) ([]byte, error)
	Hash() []byte               // return nil if this Tree is empty
	GetProof(k []byte) [][]byte // return nill of this Tree is empty
	Iterator() Iterator
	Filter(prefix []byte) Iterator
	Equal(immutable Immutable, exact bool) bool
	Prove(k []byte, p [][]byte) ([]byte, error)
	Resolve(builder merkle.Builder)
	ClearCache()
	Database() db.Database
}

type ImmutableForObject

type ImmutableForObject interface {
	Empty() bool
	Get(k []byte) (Object, error)
	Hash() []byte
	GetProof(k []byte) [][]byte // return nill of this Tree is empty
	Iterator() IteratorForObject
	Filter(prefix []byte) IteratorForObject
	Equal(object ImmutableForObject, exact bool) bool
	Prove(k []byte, p [][]byte) (Object, error)
	Resolve(builder merkle.Builder)
	ClearCache()
	Database() db.Database
}

type Iterator

type Iterator interface {
	Next() error
	Has() bool
	Get() (value []byte, key []byte, err error)
}

type IteratorForObject

type IteratorForObject interface {
	Next() error
	Has() bool
	Get() (Object, []byte, error)
}

type Manager

type Manager interface {
	NewImmutable(rootHash []byte) Immutable
	NewMutable(rootHash []byte) Mutable
	NewImmutableForObject(h []byte, t reflect.Type) ImmutableForObject
	NewMutableForObject(h []byte, t reflect.Type) MutableForObject
}

type Mutable

type Mutable interface {
	Get(k []byte) ([]byte, error)
	Set(k, v []byte) ([]byte, error)
	Delete(k []byte) ([]byte, error)
	GetSnapshot() Snapshot
	Reset(d Immutable) error
	ClearCache()
	Database() db.Database
}

type MutableForObject

type MutableForObject interface {
	Get(k []byte) (Object, error)
	Set(k []byte, o Object) (Object, error)
	Delete(k []byte) (Object, error)
	GetSnapshot() SnapshotForObject
	Reset(s ImmutableForObject)
	ClearCache()
	Database() db.Database
}

type Object

type Object interface {
	Bytes() []byte
	Reset(s db.Database, k []byte) error
	Flush() error
	Equal(Object) bool
	Resolve(builder merkle.Builder) error
	ClearCache()
}

type Snapshot

type Snapshot interface {
	Immutable
	Flush() error
}

type SnapshotForObject

type SnapshotForObject interface {
	ImmutableForObject
	Flush() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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