engine

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTaskTraceAttributes added in v0.3.10

func BuildTaskTraceAttributes(task Task) []attribute.KeyValue

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<- *Tasks, 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 Tasks added in v0.3.10

type Tasks struct {
	Tasks []Task
	// contains filtered or unexported fields
}

func (*Tasks) Get added in v0.3.10

func (t *Tasks) Get(key string) string

func (*Tasks) Keys added in v0.3.10

func (t *Tasks) Keys() []string

func (*Tasks) Len added in v0.3.10

func (t *Tasks) Len() int

func (*Tasks) Set added in v0.3.10

func (t *Tasks) Set(key string, value string)

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