types

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockBlobKeyPrefix         = "bp"
	BlockBlobIndexKeyPrefix    = "bi"
	BlockBlobMetadataKeySuffix = "_metadata"
	UtxoBlobKeyPrefix          = "u"
)

Variables

View Source
var ErrBlobKeyNotFound = errors.New("blob key not found")

ErrBlobKeyNotFound is returned by blob operations when a key is missing

View Source
var ErrBlobStoreUnavailable = errors.New("blob store unavailable")

ErrBlobStoreUnavailable is returned when blob store cannot be accessed

View Source
var ErrNilTxn = errors.New("nil transaction")

ErrNilTxn is returned when a nil transaction is provided where a valid transaction is required

View Source
var ErrNoStoreAvailable = errors.New("no store available")

ErrNoStoreAvailable is returned when no blob or metadata store is available

View Source
var ErrTxnWrongType = errors.New("invalid transaction type")

ErrTxnWrongType is returned when a transaction has the wrong type

Functions

func BlockBlobIndexKey added in v0.20.0

func BlockBlobIndexKey(blockNumber uint64) []byte

func BlockBlobKey added in v0.20.0

func BlockBlobKey(slot uint64, hash []byte) []byte

func BlockBlobKeyUint64ToBytes added in v0.20.0

func BlockBlobKeyUint64ToBytes(input uint64) []byte

func BlockBlobMetadataKey added in v0.20.0

func BlockBlobMetadataKey(baseKey []byte) []byte

func UtxoBlobKey added in v0.20.0

func UtxoBlobKey(txId []byte, outputIdx uint32) []byte

Types

type BlobItem added in v0.19.0

type BlobItem interface {
	Key() []byte
	ValueCopy(dst []byte) ([]byte, error)
}

BlobItem represents a value returned by an iterator

type BlobIterator added in v0.19.0

type BlobIterator interface {
	Rewind()
	Seek(prefix []byte)
	Valid() bool
	ValidForPrefix(prefix []byte) bool
	Next()
	Item() BlobItem
	Close()
	Err() error
}

BlobIterator provides key iteration over the blob store.

Important lifecycle constraint: items returned by `Item()` must only be accessed while the underlying transaction used to create the iterator is still active. Implementations may validate transaction state at access time (for example `ValueCopy` may fail if the transaction has been committed or rolled back). Typical usage iterates and accesses item values within the same transaction scope.

type BlobIteratorOptions added in v0.19.0

type BlobIteratorOptions struct {
	Prefix  []byte
	Reverse bool
}

BlobIteratorOptions configures blob iterator creation

type BlockMetadata added in v0.20.0

type BlockMetadata struct {
	cbor.StructAsArray
	ID       uint64
	Type     uint
	Height   uint64
	PrevHash []byte
}

BlockMetadata contains metadata for a block stored in blob

type Rat

type Rat struct {
	*big.Rat
}

func (*Rat) Scan

func (r *Rat) Scan(val any) error

func (Rat) Value

func (r Rat) Value() (driver.Value, error)

type Txn added in v0.19.0

type Txn interface {
	Commit() error
	Rollback() error
}

Txn is a simple transaction handle for commit/rollback only. Database layer (Txn) coordinates metadata and blob operations separately.

type Uint64

type Uint64 uint64

func (*Uint64) Scan

func (u *Uint64) Scan(val any) error

func (Uint64) Value

func (u Uint64) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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