@@ -29,7 +29,7 @@ import (
2929 "github.com/crowdsecurity/crowdsec/pkg/exprhelpers"
3030 "github.com/crowdsecurity/crowdsec/pkg/logging"
3131 "github.com/crowdsecurity/crowdsec/pkg/metrics"
32- "github.com/crowdsecurity/crowdsec/pkg/types "
32+ "github.com/crowdsecurity/crowdsec/pkg/pipeline "
3333)
3434
3535type DataSourceUnavailableError struct {
@@ -61,12 +61,12 @@ type DataSource interface {
6161
6262type Fetcher interface {
6363 // Start one shot acquisition(eg, cat a file)
64- OneShotAcquisition (ctx context.Context , out chan types .Event , acquisTomb * tomb.Tomb ) error
64+ OneShotAcquisition (ctx context.Context , out chan pipeline .Event , acquisTomb * tomb.Tomb ) error
6565}
6666
6767type Tailer interface {
6868 // Start live acquisition (eg, tail a file)
69- StreamingAcquisition (ctx context.Context , out chan types .Event , acquisTomb * tomb.Tomb ) error
69+ StreamingAcquisition (ctx context.Context , out chan pipeline .Event , acquisTomb * tomb.Tomb ) error
7070}
7171
7272type MetricsProvider interface {
@@ -186,7 +186,7 @@ func LoadAcquisitionFromDSN(ctx context.Context, dsn string, labels map[string]s
186186 uniqueID := uuid .NewString ()
187187
188188 if transformExpr != "" {
189- vm , err := expr .Compile (transformExpr , exprhelpers .GetExprOptions (map [string ]any {"evt" : & types .Event {}})... )
189+ vm , err := expr .Compile (transformExpr , exprhelpers .GetExprOptions (map [string ]any {"evt" : & pipeline .Event {}})... )
190190 if err != nil {
191191 return nil , fmt .Errorf ("while compiling transform expression '%s': %w" , transformExpr , err )
192192 }
@@ -353,7 +353,7 @@ func sourcesFromFile(ctx context.Context, acquisFile string, metricsLevel metric
353353 }
354354
355355 if sub .TransformExpr != "" {
356- vm , err := expr .Compile (sub .TransformExpr , exprhelpers .GetExprOptions (map [string ]any {"evt" : & types .Event {}})... )
356+ vm , err := expr .Compile (sub .TransformExpr , exprhelpers .GetExprOptions (map [string ]any {"evt" : & pipeline .Event {}})... )
357357 if err != nil {
358358 return nil , fmt .Errorf ("while compiling transform expression '%s' for datasource %s in %s (position %d): %w" , sub .TransformExpr , sub .Source , acquisFile , idx , err )
359359 }
@@ -417,8 +417,8 @@ func GetMetrics(sources []DataSource, aggregated bool) error {
417417
418418// There's no need for an actual deep copy
419419// The event is almost empty, we are mostly interested in allocating new maps for Parsed/Meta/...
420- func copyEvent (evt types .Event , line string ) types .Event {
421- evtCopy := types .MakeEvent (evt .ExpectMode == types .TIMEMACHINE , evt .Type , evt .Process )
420+ func copyEvent (evt pipeline .Event , line string ) pipeline .Event {
421+ evtCopy := pipeline .MakeEvent (evt .ExpectMode == pipeline .TIMEMACHINE , evt .Type , evt .Process )
422422 evtCopy .Line = evt .Line
423423 evtCopy .Line .Raw = line
424424 evtCopy .Line .Labels = make (map [string ]string )
@@ -428,7 +428,7 @@ func copyEvent(evt types.Event, line string) types.Event {
428428 return evtCopy
429429}
430430
431- func transform (transformChan chan types .Event , output chan types .Event , acquisTomb * tomb.Tomb , transformRuntime * vm.Program , logger * log.Entry ) {
431+ func transform (transformChan chan pipeline .Event , output chan pipeline .Event , acquisTomb * tomb.Tomb , transformRuntime * vm.Program , logger * log.Entry ) {
432432 defer trace .CatchPanic ("crowdsec/acquis" )
433433
434434 logger .Info ("transformer started" )
@@ -484,7 +484,7 @@ func transform(transformChan chan types.Event, output chan types.Event, acquisTo
484484 }
485485}
486486
487- func StartAcquisition (ctx context.Context , sources []DataSource , output chan types .Event , acquisTomb * tomb.Tomb ) error {
487+ func StartAcquisition (ctx context.Context , sources []DataSource , output chan pipeline .Event , acquisTomb * tomb.Tomb ) error {
488488 // Don't wait if we have no sources, as it will hang forever
489489 if len (sources ) == 0 {
490490 return nil
@@ -506,7 +506,7 @@ func StartAcquisition(ctx context.Context, sources []DataSource, output chan typ
506506 if transformRuntime , ok := transformRuntimes [subsrc .GetUuid ()]; ok {
507507 log .Infof ("transform expression found for datasource %s" , subsrc .GetName ())
508508
509- transformChan := make (chan types .Event )
509+ transformChan := make (chan pipeline .Event )
510510 outChan = transformChan
511511 transformLogger := log .WithFields (log.Fields {
512512 "component" : "transform" ,
0 commit comments