events

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 9 Imported by: 2 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

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 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 int
}

func NewChunkEvent

func NewChunkEvent(executionId string, chunkNumber int) *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      int
	ChunksWritten int
	Err           error
}

func NewCompletedEvent

func NewCompletedEvent(executionId string, rowCount int, chunksWritten int, 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 SourceCompleteFromProto

func SourceCompleteFromProto(e *proto.Event) Event

func SourceEventFromProto

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

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

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, SourceEnrichmens 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 NewSourceCompletedEvent

func NewSourceCompletedEvent(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
	ArtifactErrors           int64 // *
	RowsReceived             int64
	RowsEnriched             int64
	Errors                   int64
	// contains filtered or unexported fields
}

func NewStatusEvent

func NewStatusEvent(executionId string) *Status

func (*Status) Equals

func (r *Status) Equals(status *Status) bool

func (*Status) OnRowEnriched

func (r *Status) OnRowEnriched()

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