plugins

package
v0.0.0-...-09e306e Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseExtractor

type BaseExtractor[Opts any, Feature db.Table] struct {
	// Options to pass via yaml to this step.
	libconf.JsonOpts[Opts]
	// Database connection where the datasources are stored.
	DB *db.DB

	RecencySeconds int
	UpdatedAt      *time.Time
	// contains filtered or unexported fields
}

Common base for all extractors that provides some functionality that would otherwise be duplicated across all extractors.

func (*BaseExtractor[Opts, F]) ExtractSQL

func (e *BaseExtractor[Opts, F]) ExtractSQL(query string) ([]Feature, error)

Extract the features directly from an sql query.

func (*BaseExtractor[Opts, F]) Extracted

func (e *BaseExtractor[Opts, F]) Extracted(fs []F) ([]Feature, error)

Return the extracted features as a slice of generic features for counting.

func (*BaseExtractor[Opts, Feature]) Init

func (e *BaseExtractor[Opts, Feature]) Init(datasourceDB, extractorDB *db.DB, spec v1alpha1.KnowledgeSpec) error

Init the extractor with the database and options.

type Feature

type Feature any

type FeatureExtractor

type FeatureExtractor interface {
	// Configure the feature extractor with a spec and (optional) databases.
	Init(datasourceDB *db.DB, extractorDB *db.DB, spec v1alpha1.KnowledgeSpec) error
	// Extract features from the given data.
	Extract() ([]Feature, error)
}

Each feature extractor must conform to this interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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