events

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 11 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

View Source
const StatusUpdateInterval = 250 * time.Millisecond

Variables

This section is empty.

Functions

func DurationToProto

func DurationToProto(d time.Duration) *durationpb.Duration

func ProtoToDuration

func ProtoToDuration(d *durationpb.Duration) time.Duration

func ProtoToTime

func ProtoToTime(ts *timestamppb.Timestamp) time.Time

func TimeToProto

func TimeToProto(t time.Time) *timestamppb.Timestamp

Types

type ArtifactConverted added in v0.3.0

type ArtifactConverted struct {
	Base
	ExecutionId string
	Info        *types.DownloadedArtifactInfo
	RowCount    int64
}

func NewArtifactConvertedEvent added in v0.3.0

func NewArtifactConvertedEvent(executionId string, info *types.DownloadedArtifactInfo, rowsConverted int64) *ArtifactConverted

type ArtifactDiscovered

type ArtifactDiscovered struct {
	Base
	ExecutionId string
	Info        *types.ArtifactInfo
}

func NewArtifactDiscoveredEvent

func NewArtifactDiscoveredEvent(executionId string, info *types.ArtifactInfo) *ArtifactDiscovered

func (*ArtifactDiscovered) ToProto

func (c *ArtifactDiscovered) ToProto() *proto.Event

type ArtifactDownloaded

type ArtifactDownloaded struct {
	Base
	ExecutionId string
	Info        *types.DownloadedArtifactInfo
}

func NewArtifactDownloadedEvent

func NewArtifactDownloadedEvent(executionId string, info *types.DownloadedArtifactInfo) *ArtifactDownloaded

func (*ArtifactDownloaded) ToProto

func (c *ArtifactDownloaded) ToProto() *proto.Event

type ArtifactExtracted

type ArtifactExtracted struct {
	Base
	ExecutionId string
	Info        *types.DownloadedArtifactInfo
}

ArtifactExtracted is an event that is fired by an ExtractorSource when it has extracted an artifact (but not yet processed it into rows)

func NewArtifactExtractedEvent

func NewArtifactExtractedEvent(executionId string, info *types.DownloadedArtifactInfo, rowsExtracted int64) *ArtifactExtracted

func (*ArtifactExtracted) ToProto

func (c *ArtifactExtracted) ToProto() *proto.Event

ToProto converts the event to a proto event

type Base

type Base struct {
}

Base is the base struct for all events - it implements the marker function isEvent

type Chunk

type Chunk struct {
	Base
	ExecutionId string
	ChunkNumber int32
}

func NewChunkEvent

func NewChunkEvent(executionId string, chunkNumber int32) *Chunk

func (*Chunk) ToProto

func (r *Chunk) ToProto() *proto.Event

ToProto converts the event to a proto.Event

type Complete

type Complete struct {
	Base
	ExecutionId   string
	RowCount      int64
	ChunksWritten int32
	Err           error
}

func NewCompletedEvent

func NewCompletedEvent(executionId string, rowCount int64, chunksWritten int32, err error) *Complete

func (*Complete) ToProto

func (c *Complete) ToProto() *proto.Event

type Error

type Error struct {
	Base
	ExecutionId string
	Err         error
}

func NewErrorEvent

func NewErrorEvent(executionId string, err error) *Error

func (*Error) ToProto

func (c *Error) ToProto() *proto.Event

type Event

type Event interface {
	// contains filtered or unexported methods
}

func ArtifactDiscoveredFromProto

func ArtifactDiscoveredFromProto(e *proto.Event) Event

func ArtifactDownloadedFromProto

func ArtifactDownloadedFromProto(e *proto.Event) Event

func ArtifactExtractedFromProto

func ArtifactExtractedFromProto(e *proto.Event) Event

func ChunkWrittenFromProto added in v0.5.0

func ChunkWrittenFromProto(e *proto.Event) Event

func CompleteFromProto added in v0.5.0

func CompleteFromProto(e *proto.Event) Event

func ErrorFromProto added in v0.3.0

func ErrorFromProto(e *proto.Event) Event

func EventFromProto added in v0.5.0

func EventFromProto(e *proto.Event) (Event, error)

EventFromProto converts a proto.Event to an Event NOTE: this function is used for sources implemented in external plugins so handles source events ONLY

func HeaderFromProto added in v0.4.0

func HeaderFromProto(e *proto.Event) Event

func SourceCompleteFromProto

func SourceCompleteFromProto(e *proto.Event) Event

func StartedFromProto added in v0.5.0

func StartedFromProto(e *proto.Event) Event
type Header struct {
	Base
	ExecutionId string
	Info        *types.ArtifactInfo
	Header      []string
}

func NewHeaderEvent added in v0.4.0

func NewHeaderEvent(executionId string, info *types.ArtifactInfo, header []string) *Header

func (*Header) ToProto added in v0.4.0

func (c *Header) ToProto() *proto.Event

type ProtoEvent

type ProtoEvent interface {
	ToProto() *proto.Event
}

ProtoEvent is an interface for events that can be converted to a proto.Event

type RowExtracted

type RowExtracted struct {
	Base
	ExecutionId string

	// enrichment values passed from the source to the collection to include in the enrichment process
	SourceEnrichment schema.SourceEnrichment
	Row              any
}

func NewRowExtractedEvent

func NewRowExtractedEvent(executionId string, row any, sourceEnrichments schema.SourceEnrichment) *RowExtracted

type SourceComplete

type SourceComplete struct {
	Base
	ExecutionId string
	Err         error
}

SourceComplete is an event that is fired when a plugin used a source has completed a source collection

func NewSourceCompleteEvent added in v0.2.0

func NewSourceCompleteEvent(executionId string, err error) *SourceComplete

func (*SourceComplete) ToProto

func (c *SourceComplete) ToProto() *proto.Event

type Started

type Started struct {
	Base
	ExecutionId string
}

func NewStartedEvent

func NewStartedEvent(executionId string) *Started

func (*Started) ToProto

func (s *Started) ToProto() *proto.Event

type Status

type Status struct {
	Base
	ExecutionId              string
	LatestArtifactLocation   string
	ArtifactsDiscovered      int64
	ArtifactsDownloaded      int64
	ArtifactsDownloadedBytes int64
	ArtifactsExtracted       int64
	SourceErrors             []string
	RowsReceived             int64
	RowsEnriched             int64
	// deprecated
	Errors    int64
	RowErrors *error_types.RowErrors
	// contains filtered or unexported fields
}

func NewStatusEvent

func NewStatusEvent(executionId string) *Status

func StatusFromProto added in v0.2.0

func StatusFromProto(e *proto.Event) *Status

func (*Status) OnRowEnriched

func (r *Status) OnRowEnriched()

func (*Status) OnRowError added in v0.2.0

func (r *Status) OnRowError(err error_types.RowError)

OnRowError increments the error count and adds the error to the RowErrors This happens from CLI side, so no need to pass events

func (*Status) ToProto

func (r *Status) ToProto() *proto.Event

func (*Status) Update

func (r *Status) Update(event Event)

Jump to

Keyboard shortcuts

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