Documentation
¶
Index ¶
- Constants
- func DurationToProto(d time.Duration) *durationpb.Duration
- func ProtoToDuration(d *durationpb.Duration) time.Duration
- func ProtoToTime(ts *timestamppb.Timestamp) time.Time
- func TimeToProto(t time.Time) *timestamppb.Timestamp
- type ArtifactConverted
- type ArtifactDiscovered
- type ArtifactDownloaded
- type ArtifactExtracted
- type Base
- type Chunk
- type Complete
- type Error
- type Event
- func ArtifactDiscoveredFromProto(e *proto.Event) Event
- func ArtifactDownloadedFromProto(e *proto.Event) Event
- func ArtifactExtractedFromProto(e *proto.Event) Event
- func ChunkWrittenFromProto(e *proto.Event) Event
- func CompleteFromProto(e *proto.Event) Event
- func ErrorFromProto(e *proto.Event) Event
- func EventFromProto(e *proto.Event) (Event, error)
- func HeaderFromProto(e *proto.Event) Event
- func SourceCompleteFromProto(e *proto.Event) Event
- func StartedFromProto(e *proto.Event) Event
- type Header
- type ProtoEvent
- type RowExtracted
- type SourceComplete
- type Started
- type Status
Constants ¶
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 ¶
func NewChunkEvent ¶
type Complete ¶
func NewCompletedEvent ¶
type Error ¶
func NewErrorEvent ¶
type Event ¶
type Event interface {
// contains filtered or unexported methods
}
func ChunkWrittenFromProto ¶ added in v0.5.0
func CompleteFromProto ¶ added in v0.5.0
func ErrorFromProto ¶ added in v0.3.0
func EventFromProto ¶ added in v0.5.0
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 SourceCompleteFromProto ¶
func StartedFromProto ¶ added in v0.5.0
type Header ¶ added in v0.4.0
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
type ProtoEvent ¶
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 ¶
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 ¶
func NewStartedEvent ¶
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 StatusFromProto ¶ added in v0.2.0
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