agent

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent runs recipes for specified plugins.

func NewAgent

func NewAgent(config Config) *Agent

NewAgent returns an Agent with plugin factories.

func (*Agent) Run

func (r *Agent) Run(ctx context.Context, recipe recipe.Recipe) (run Run)

Run executes the specified recipe.

func (*Agent) RunMultiple

func (r *Agent) RunMultiple(ctx context.Context, recipes []recipe.Recipe) []Run

RunMultiple executes multiple recipes.

func (*Agent) Validate

func (r *Agent) Validate(rcp recipe.Recipe) []error

Validate checks the recipe for linting errors.

type Config

type Config struct {
	ExtractorFactory     *registry.ExtractorFactory
	ProcessorFactory     *registry.ProcessorFactory
	SinkFactory          *registry.SinkFactory
	Monitor              Monitor
	Logger               log.Logger
	MaxRetries           int
	RetryInitialInterval time.Duration
	StopOnSinkError      bool
	TimerFn              TimerFn
	SinkBatchSize        int
	DryRun               bool
	RecordLimit          int
}

type Monitor

type Monitor interface {
	RecordRun(ctx context.Context, run Run)
	RecordPlugin(ctx context.Context, pluginInfo PluginInfo)
	RecordSinkRetryCount(ctx context.Context, pluginInfo PluginInfo)
}

Monitor is the interface for monitoring the agent.

type PluginInfo added in v0.9.1

type PluginInfo struct {
	RecipeName string
	PluginName string
	PluginType string
	Success    bool
	BatchSize  int
}

type Run

type Run struct {
	Recipe           recipe.Recipe  `json:"recipe"`
	Error            error          `json:"error"`
	DurationInMs     int            `json:"duration_in_ms"`
	ExtractorRetries int            `json:"extractor_retries"`
	RecordsExtracted int            `json:"records_extracted"`
	RecordCount      int            `json:"record_count"`
	Success          bool           `json:"success"`
	EntityTypes      map[string]int `json:"entity_types,omitempty"`
	DryRun           bool           `json:"dry_run,omitempty"`
}

Run contains the json data

type TimerFn

type TimerFn func() func() int

TimerFn of function type

Jump to

Keyboard shortcuts

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