metadata

package
v0.72.0-preview.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownSnapshotVersion = errors.New("unknown snapshot version")

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Save(version []byte, state []byte) error
	Load(version []byte) (state []byte, err error)
	Close() error
	Clear() error
}

type Database

type Database struct {
	Adapter
}

func NewDatabase

func NewDatabase(adapter Adapter) *Database

func (*Database) Load

func (d *Database) Load(version int64) (*tmtypes.Snapshot, error)

func (*Database) Save

func (d *Database) Save(version int64, state *tmtypes.Snapshot) error

type InMemoryAdapter

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

func NewInMemoryAdapter

func NewInMemoryAdapter() *InMemoryAdapter

func (*InMemoryAdapter) Clear

func (a *InMemoryAdapter) Clear() error

func (*InMemoryAdapter) Close

func (a *InMemoryAdapter) Close() error

func (*InMemoryAdapter) Load

func (a *InMemoryAdapter) Load(version []byte) (state []byte, err error)

func (*InMemoryAdapter) Save

func (a *InMemoryAdapter) Save(version []byte, state []byte) error

type LevelDBAdapter

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

func NewLevelDBAdapter

func NewLevelDBAdapter(vegaPaths paths.Paths) (*LevelDBAdapter, error)

func (*LevelDBAdapter) Clear

func (a *LevelDBAdapter) Clear() error

func (*LevelDBAdapter) Close

func (a *LevelDBAdapter) Close() error

func (*LevelDBAdapter) Load

func (a *LevelDBAdapter) Load(version []byte) ([]byte, error)

func (*LevelDBAdapter) Save

func (a *LevelDBAdapter) Save(version []byte, state []byte) error

Jump to

Keyboard shortcuts

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