engine

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	ID         string          `json:"id"`
	Network    filter.Network  `json:"network"`
	Worker     string          `json:"worker"`
	State      json.RawMessage `json:"state"`
	IndexCount int64           `json:"index_count"`
	UpdatedAt  time.Time       `json:"updated_at"`
}

type CheckpointTransformer

type CheckpointTransformer interface {
	Import(checkpoint *Checkpoint) error
	Export() (*Checkpoint, error)
}

type Source

type Source interface {
	Network() filter.Network
	State() json.RawMessage
	Start(ctx context.Context, tasksChan chan<- []Task, errorChan chan<- error)
}

type SourceFilter

type SourceFilter interface{}

type Task

type Task interface {
	ID() string
	GetNetwork() filter.Network
	GetTimestamp() uint64
	Validate() error
	BuildFeed(options ...schema.FeedOption) (*schema.Feed, error)
}

type Worker

type Worker interface {
	Name() string
	Filter() SourceFilter
	Match(ctx context.Context, task Task) (bool, error)
	Transform(ctx context.Context, task Task) (*schema.Feed, error)
}

Jump to

Keyboard shortcuts

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