dataextractor

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToPresent = false
	ToPast    = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchMode

type BranchMode uint8
const (
	IgnoreBranch BranchMode
	FollowBranch
	IncludeBranch
)

type Config

type Config struct {
	Selector Selector
	Limiter  Limiter
	Output   Output
	Target   pulse.Number
}

func (Config) Ensure

func (v Config) Ensure()

type Direction

type Direction bool

func (Direction) IsToPast

func (v Direction) IsToPast() bool

type Iterator

type Iterator interface {
	Direction() Direction
	CurrentEntry() ledger.DirectoryIndex
	ExtraEntries() []ledger.DirectoryIndex

	// Next retrieves a next entry in a sequence. Arg (prevRef) should be provided irrelevant of direction
	Next(prevRef reference.Holder) (bool, error)
}

type Limiter

type Limiter interface {
	CanRead() bool
	IsSkipped(recType uint32) bool
	CanReadExcerpt() bool
	CanReadBody() bool
	CanReadPayload() bool
	CanReadExtensions() bool
	CanReadExtension(ledger.ExtensionID) bool

	Next(consumedSize int, nextRecRef reference.Holder)

	Clone() Limiter
}

func NewLimiter

func NewLimiter(limits Limits) Limiter

func NewNoLimits

func NewNoLimits() Limiter

type Limits

type Limits struct {
	StopRef   reference.Global
	TotalSize uint64

	TotalCount uint32
	Excerpts   uint32
	Bodies     uint32
	Payloads   uint32
	Extensions uint32

	RecTypeFilter func(uint32) bool
	ExtTypeFilter func(ledger.ExtensionID) bool

	ExcludeStart bool
	ExcludeStop  bool
}

type Output

type Output interface {
	BeginEntry(entry *catalog.Entry, fullExcerpt bool) error
	AddBody(readbundle.Slice) error
	AddPayload(readbundle.Slice) error
	AddExtension(ledger.ExtensionID, readbundle.Slice) error
	EndEntry() (consumedSize int, err error)
}

type Selector

type Selector struct {
	RootRef   reference.Holder
	ReasonRef reference.Holder
	StartRef  reference.Holder
	StopRef   reference.Holder

	BranchMode BranchMode
	Direction  Direction
}

func (Selector) GetSelectorRef

func (v Selector) GetSelectorRef() (bool, reference.Holder)

type SequenceReader

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

func NewSequenceReader

func NewSequenceReader(iter Iterator, lim Limiter, out Output) *SequenceReader

func (*SequenceReader) HasMore

func (p *SequenceReader) HasMore() bool

func (*SequenceReader) ReadAll

func (p *SequenceReader) ReadAll() error

func (*SequenceReader) ReadNext

func (p *SequenceReader) ReadNext() (bool, error)

func (*SequenceReader) SetPrevRef

func (p *SequenceReader) SetPrevRef(ref reference.Holder)

func (*SequenceReader) SetReader

func (p *SequenceReader) SetReader(reader readbundle.BasicReader)

Jump to

Keyboard shortcuts

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