utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(db db.Database, prefix []byte) error

Clear removes all keys with the given prefix

func Count

func Count(db db.Database, prefix []byte) (int, error)

Count returns the number of keys with the given prefix

func GetBool

func GetBool(db db.KeyValueReader, key []byte) (bool, error)

GetBool reads [prefix] + [key] -> [value]

func GetHash

func GetHash(db db.KeyValueReader, key []byte) (common.Hash, error)

GetHash reads [prefix] + [key] -> hash

func GetID

func GetID(db db.KeyValueReader, key []byte) ([]byte, error)

GetID reads [id] -> [value]

func GetTimestamp

func GetTimestamp(db db.KeyValueReader, key []byte) (time.Time, error)

GetTimestamp reads [prefix] + [key] -> [timestamp]

func GetUInt32

func GetUInt32(db db.KeyValueReader, key []byte) (uint32, error)

GetUInt32 reads [prefix] + [key] -> [value]

func GetUInt64

func GetUInt64(db db.KeyValueReader, key []byte) (uint64, error)

GetUInt64 reads [prefix] + [key] -> [value]

func ParseBool

func ParseBool(bytes []byte) (bool, error)

ParseBool parses a bool from bytes

func ParseHash

func ParseHash(bytes []byte) (common.Hash, error)

ParseHash parses a hash from bytes

func ParseID

func ParseID(bytes []byte) ([]byte, error)

ParseID reads [id] -> [value]

func ParseTimestamp

func ParseTimestamp(bytes []byte) (time.Time, error)

ParseTimestamp parses a timestamp from bytes

func ParseUInt32

func ParseUInt32(bytes []byte) (uint32, error)

ParseUInt32 parses a uint32 from bytes

func ParseUInt64

func ParseUInt64(bytes []byte) (uint64, error)

ParseUInt64 parses a uint64 from bytes

func PutBool

func PutBool(db db.KeyValueWriter, key []byte, val bool) error

PutBool stores [prefix] + [key] -> [value]

func PutHash

func PutHash(db db.KeyValueWriter, key []byte, hash common.Hash) error

PutHash stores [prefix] + [key] -> hash

func PutID

func PutID(db db.KeyValueWriter, key []byte, val []byte) error

PutID stores [id] -> [value]

func PutTimestamp

func PutTimestamp(db db.KeyValueWriter, key []byte, val time.Time) error

PutTimestamp stores [prefix] + [key] -> [timestamp]

func PutUInt32

func PutUInt32(db db.KeyValueWriter, key []byte, val uint32) error

PutUInt32 stores [prefix] + [key] -> [value]

func PutUInt64

func PutUInt64(db db.KeyValueWriter, key []byte, val uint64) error

PutUInt64 stores [prefix] + [key] -> [value]

Types

This section is empty.

Jump to

Keyboard shortcuts

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