enrichments

package
v0.0.0-...-ebc7474 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 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 Enrichment

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

func NewEnrichment

func NewEnrichment(name string, setters ...EnrichmentOption) Enrichment

func (*Enrichment) Enrich

func (e *Enrichment) Enrich(ctx context.Context, record shared.Record) error

func (*Enrichment) Name

func (e *Enrichment) Name() string

func (*Enrichment) String

func (e *Enrichment) String() string

type EnrichmentConstructor

type EnrichmentConstructor func(config map[string]string) (IEnrichment, error)

type EnrichmentError

type EnrichmentError struct {
	Message string
}

EnrichmentError custom error for enrichment functions

func (*EnrichmentError) Error

func (e *EnrichmentError) Error() string

type EnrichmentOption

type EnrichmentOption func(*Enrichment)

func Description

func Description(description string) EnrichmentOption

func Disabled

func Disabled(Disabled bool) EnrichmentOption

func ID

func ID(id string) EnrichmentOption

func Name

func Name(name string) EnrichmentOption

type EnrichmentRepository

type EnrichmentRepository struct {
	Enrichments map[string]IEnrichment
	// contains filtered or unexported fields
}

func GetEnrichmentRepository

func GetEnrichmentRepository() *EnrichmentRepository

func NewEnrichmentRepository

func NewEnrichmentRepository() EnrichmentRepository

func (*EnrichmentRepository) GetEnrichment

func (apr *EnrichmentRepository) GetEnrichment(name string) (IEnrichment, error)

func (*EnrichmentRepository) HasEnrichment

func (apr *EnrichmentRepository) HasEnrichment(name string) bool

func (*EnrichmentRepository) LoadEnrichments

func (apr *EnrichmentRepository) LoadEnrichments(path string) error

func (*EnrichmentRepository) RegisterEnrichment

func (apr *EnrichmentRepository) RegisterEnrichment(enrichment IEnrichment) error

type EnrichmentTiming

type EnrichmentTiming int
const (
	Before EnrichmentTiming = iota
	After
)

type IEnrichment

type IEnrichment interface {
	Enrich(ctx context.Context, record shared.Record) error
	Name() string
	String() string
}

Jump to

Keyboard shortcuts

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