linkedlog

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB = 1024
	MiB = 1024 * KiB
	GiB = 1024 * MiB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmap added in v0.6.0

type Bitmap byte

func NewBitmap added in v0.6.0

func NewBitmap() Bitmap

func NewBitmapFromValues added in v0.6.0

func NewBitmapFromValues(values ...bool) Bitmap

func (Bitmap) Get added in v0.6.0

func (b Bitmap) Get(index int) bool

Get returns the value of the bit at the given index.

func (Bitmap) IsEmpty added in v0.6.0

func (b Bitmap) IsEmpty() bool

IsEmpty returns true if all the bits are unset.

func (*Bitmap) Set added in v0.6.0

func (b *Bitmap) Set(index int, value bool)

Set sets the value of the bit at the given index.

type KeyToOffsetAndSizeAndBlocktime added in v0.4.0

type KeyToOffsetAndSizeAndBlocktime struct {
	Key    solana.PublicKey
	Values []*OffsetAndSizeAndSlot
}

type KeyToOffsetAndSizeAndBlocktimeSlice added in v0.4.0

type KeyToOffsetAndSizeAndBlocktimeSlice []KeyToOffsetAndSizeAndBlocktime

func (KeyToOffsetAndSizeAndBlocktimeSlice) Has added in v0.4.0

func (s KeyToOffsetAndSizeAndBlocktimeSlice) Has(key solana.PublicKey) bool

Has returns true if the given public key is in the slice.

type LinkedLog

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

func NewLinkedLog

func NewLinkedLog(filename string) (*LinkedLog, error)

func (*LinkedLog) Close

func (s *LinkedLog) Close() error

func (*LinkedLog) Flush

func (s *LinkedLog) Flush() error

Flush flushes the buffer to disk

func (*LinkedLog) Put

func (s *LinkedLog) Put(
	callbackBefore func(pk solana.PublicKey) (indexes.OffsetAndSize, error),
	callbackAfter func(pk solana.PublicKey, offset uint64, ln uint32) error,
	values ...KeyToOffsetAndSizeAndBlocktime,
) (uint64, error)

func (*LinkedLog) Read

Read reads the block stored at the given offset.

func (*LinkedLog) ReadWithSize added in v0.4.0

func (s *LinkedLog) ReadWithSize(offset uint64, size uint64) ([]OffsetAndSizeAndSlot, indexes.OffsetAndSize, error)

type OffsetAndSizeAndSlot added in v0.6.0

type OffsetAndSizeAndSlot struct {
	Offset uint64 // encoded as uvarint
	Size   uint64 // encoded as uvarint
	Slot   uint64 // encoded as uvarint
	Flags  Bitmap // encoded as byte
}

func NewOffsetAndSizeAndSlot added in v0.6.0

func NewOffsetAndSizeAndSlot(offset uint64, size uint64, slot uint64) *OffsetAndSizeAndSlot

func OffsetAndSizeAndSlotSliceFromBytes added in v0.6.0

func OffsetAndSizeAndSlotSliceFromBytes(buf []byte) ([]OffsetAndSizeAndSlot, error)

func (OffsetAndSizeAndSlot) Bytes added in v0.6.0

func (oas OffsetAndSizeAndSlot) Bytes() []byte

Bytes returns the offset and size as a byte slice.

func (*OffsetAndSizeAndSlot) FromBytes added in v0.6.0

func (oas *OffsetAndSizeAndSlot) FromBytes(buf []byte) error

FromBytes parses the offset and size from a byte slice.

func (*OffsetAndSizeAndSlot) FromReader added in v0.6.0

func (oas *OffsetAndSizeAndSlot) FromReader(r UvarintReader) error

func (*OffsetAndSizeAndSlot) HasMeta added in v0.6.0

func (oas *OffsetAndSizeAndSlot) HasMeta() bool

HasMeta returns true if the transaction had metadata.

func (*OffsetAndSizeAndSlot) IsSuccess added in v0.6.0

func (oas *OffsetAndSizeAndSlot) IsSuccess() bool

IsSuccess returns the isSuccess flag.

func (*OffsetAndSizeAndSlot) IsVote added in v0.6.0

func (oas *OffsetAndSizeAndSlot) IsVote() bool

IsVote returns the isVote flag.

func (*OffsetAndSizeAndSlot) SetHasMeta added in v0.6.0

func (oas *OffsetAndSizeAndSlot) SetHasMeta(hasMeta bool)

SetHasMeta sets the hasMeta flag.

func (*OffsetAndSizeAndSlot) SetIsSuccess added in v0.6.0

func (oas *OffsetAndSizeAndSlot) SetIsSuccess(isSuccess bool)

SetIsSuccess sets the isSuccess flag.

func (*OffsetAndSizeAndSlot) SetIsVote added in v0.6.0

func (oas *OffsetAndSizeAndSlot) SetIsVote(isVote bool)

SetIsVote sets the isVote flag.

type UvarintReader added in v0.4.0

type UvarintReader interface {
	ReadUvarint() (uint64, error)
	ReadByte() (byte, error)
}

Jump to

Keyboard shortcuts

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