readbundle

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalTo

func UnmarshalTo(from io.WriterTo, to Unmarshaler) error

func UnmarshalToFunc

func UnmarshalToFunc(from io.WriterTo, toFn func([]byte) error) error

Types

type BasicReader

type BasicReader interface {
	// GetDirectoryEntry returns key and entry's locator for the given index. Invalid index will return (nil, 0)
	GetDirectoryEntryLocator(ledger.DirectoryIndex) (ledger.StorageLocator, error)
	// GetEntryStorage returns start of byte slice for the given locator. Invalid locator will return nil.
	GetEntryStorage(ledger.StorageLocator) (Slice, error)
	// GetPayloadStorage returns start of byte slice for the given locator and size. Invalid locator will return nil.
	// WARNING! Implementation MAY NOT check if size is longer than the actual content for the given locator.
	GetPayloadStorage(ledger.StorageLocator, int) (Slice, error)
}

BasicReader provides basic read access. WARNING! Caller MUST NOT change the byte slice.

type DirectoryIndexFinder

type DirectoryIndexFinder interface {
	LookupByIndex(ledger.DirectoryIndex) (ledger.DirectoryIndex, error)
}

type FindProvider

type FindProvider interface {
	FinderOfNext(ledger.SectionID) DirectoryIndexFinder
	FinderOfFirst(ledger.SectionID) DirectoryIndexFinder
	FinderOfLast(ledger.SectionID) DirectoryIndexFinder
}

type Provider

type Provider interface {
	FindCabinet(pulse.Number) (ReadCabinet, error)
}

type ReadCabinet

type ReadCabinet interface {
	PulseNumber() pulse.Number

	Open() error
	Reader() Reader
	io.Closer
}

type Reader

type Reader interface {
	BasicReader
	FindProvider

	FindDirectoryEntryLocator(ledger.SectionID, reference.Holder) (ledger.StorageLocator, error)
	FindDirectoryEntry(ledger.SectionID, reference.Holder) (ledger.Ordinal, error)
}

type Slice

type Slice interface {
	longbits.FixedReader
}

func WrapBytes

func WrapBytes(b []byte) Slice

type Unmarshaler

type Unmarshaler interface {
	Unmarshal([]byte) error
}

Jump to

Keyboard shortcuts

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