Documentation ¶
Index ¶
- type DB
- type DBID
- type DBMap
- type DBStats
- type DBs
- type MemDB
- func (db *MemDB) Get(root beacon.Root) (state *beacon.BeaconStateView, exists bool, err error)
- func (db *MemDB) List() (out []beacon.Root)
- func (db *MemDB) Path() string
- func (db *MemDB) Remove(root beacon.Root) (exists bool, err error)
- func (db *MemDB) Spec() *beacon.Spec
- func (db *MemDB) Stats() DBStats
- func (db *MemDB) Store(ctx context.Context, state *beacon.BeaconStateView) (exists bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { // Store a state. // Returns exists=true if the state exists (previously), false otherwise. If error, it may not be accurate. Store(ctx context.Context, state *beacon.BeaconStateView) (exists bool, err error) // Get a state. The state is a view of a shared immutable backing. // The view is save to mutate (it forks away from the original backing) Get(root beacon.Root) (state *beacon.BeaconStateView, exists bool, err error) // Remove removes a state from the DB. Removing a state that does not exist is safe. // Returns exists=true if the state exists (previously), false otherwise. If error, it may not be accurate. Remove(root beacon.Root) (exists bool, err error) // Stats shows some database statistics such as latest write key and entry count. Stats() DBStats // List all known state roots List() []beacon.Root // Get Path Path() string // Spec of states Spec() *beacon.Spec }
type DBMap ¶ added in v0.2.1
type DBMap struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.