MCPcopy
hub / github.com/crowdsecurity/crowdsec / StreamingAcquisition

Method StreamingAcquisition

pkg/acquisition/modules/docker/run.go:490–510  ·  view source on GitHub ↗
(ctx context.Context, out chan pipeline.Event, t *tomb.Tomb)

Source from the content-addressed store, hash-verified

488}
489
490func (d *Source) StreamingAcquisition(ctx context.Context, out chan pipeline.Event, t *tomb.Tomb) error {
491 d.t = t
492 containerChan := make(chan *ContainerConfig)
493 containerDeleteChan := make(chan *ContainerConfig)
494 serviceChan := make(chan *ContainerConfig)
495 serviceDeleteChan := make(chan *ContainerConfig)
496
497 d.logger.Infof("Starting docker acquisition")
498
499 t.Go(func() error {
500 return d.ContainerManager(ctx, containerChan, containerDeleteChan, out)
501 })
502
503 if d.isSwarmManager {
504 t.Go(func() error {
505 return d.ServiceManager(ctx, serviceChan, serviceDeleteChan, out)
506 })
507 }
508
509 return d.Watch(ctx, containerChan, containerDeleteChan, serviceChan, serviceDeleteChan)
510}
511
512func ReadTailScanner(scanner *bufio.Scanner, out chan string, t *tomb.Tomb) error {
513 for scanner.Scan() {

Callers 1

TestStreamingAcquisitionFunction · 0.95

Calls 3

ContainerManagerMethod · 0.95
ServiceManagerMethod · 0.95
WatchMethod · 0.95

Tested by 1

TestStreamingAcquisitionFunction · 0.76