indexer

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer

type Indexer interface {
	// TipSet indexes a TipSet. The returned error is non-nill if a fatal error is encountered. True is returned if the
	// TipSet is indexed successfully, false if returned if the TipSet was only partially indexer.
	TipSet(ctx context.Context, ts *types.TipSet, opts ...Option) (bool, error)
}

Indexer implemented to index TipSets.

type IndexerOptions added in v0.10.0

type IndexerOptions struct {
	IndexType IndexerType
	Tasks     []string
	Interval  int
}

IndexerOptions are used by implementations of the Indexer interface for configuration.

func ConstructOptions added in v0.10.0

func ConstructOptions(opts ...Option) (IndexerOptions, error)

ConstructOptions returns an IndexerOptions struct that may be used to configured implementations of the Indexer interface.

type IndexerType added in v0.10.0

type IndexerType int
const (
	Undefined IndexerType = iota
	Watch
	Walk
	Index
	Fill
)

func (IndexerType) String added in v0.10.0

func (i IndexerType) String() string

type ModelExporter

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

func NewModelExporter

func NewModelExporter(name string) *ModelExporter

func (*ModelExporter) ExportResult

func (me *ModelExporter) ExportResult(ctx context.Context, strg model.Storage, height int64, results []*ModelResult) error

ExportResult persists []ModelResult `results` to model.Storage `strg`. An error is returned if persisting the model fails. This method will block if models at `height` are being persisted allowing the following constraints to be met: - if data with height N and SR1 is being persisted and a request to persist data with the same values is made, allow it - if data with height N and SR2 is being persisted and a request to persist data with height N and SR1 is made, block

type ModelResult

type ModelResult struct {
	Name  string
	Model model.Persistable
}

type Option added in v0.10.0

type Option interface {
	// String returns a string representation of the option.
	String() string

	// Type describes the type of the option.
	Type() OptionType

	// Value returns a value used to create this option.
	Value() interface{}
}

Option specifies the index processing behavior. The interface allows implementations of the Indexer interface to be configured independently without changing the declaration of the Indexer.TipSet method.

func WithIndexerType added in v0.10.0

func WithIndexerType(it IndexerType) Option

WithIndexerType returns and Option that specifies the type of index operation being performed. It is used by the distributed indexer to determine priority of the TipSet being indexed.

func WithInterval added in v0.17.1

func WithInterval(interval int) Option

func WithTasks added in v0.10.0

func WithTasks(tasks []string) Option

WithTasks returns and Option that specifies the tasks to be indexed. It is used by both the distributed and integrated indexers.

type OptionType added in v0.10.0

type OptionType int
const (
	IndexTypeOpt OptionType = iota
	TasksOpt
	IntervalOpt
)

Directories

Path Synopsis
Code generate by: `make tasks-gen`.
Code generate by: `make tasks-gen`.

Jump to

Keyboard shortcuts

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