Skip to content

Commit

Permalink
Revert "[ASCII-2562] Migrate forward eventplatform component to the l…
Browse files Browse the repository at this point in the history
…atest file structure" (#31563)
  • Loading branch information
GustavoCaso authored Nov 28, 2024
1 parent 0f9693f commit b80f86c
Show file tree
Hide file tree
Showing 74 changed files with 445 additions and 400 deletions.
4 changes: 2 additions & 2 deletions cmd/agent/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import (
dogstatsdStatusimpl "github.com/DataDog/datadog-agent/comp/dogstatsd/status/statusimpl"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
langDetectionCl "github.com/DataDog/datadog-agent/comp/languagedetection/client"
Expand Down Expand Up @@ -424,7 +424,7 @@ func getSharedFxOption() fx.Option {
langDetectionClimpl.Module(),
metadata.Bundle(),
orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDefaultParams()),
eventplatformfx.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()),
eventplatformreceiverimpl.Module(),

// injecting the shared Serializer to FX until we migrate it to a proper component. This allows other
Expand Down
6 changes: 3 additions & 3 deletions cmd/agent/subcommands/snmp/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/fx-noop"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
Expand Down Expand Up @@ -97,7 +97,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()),
forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithFeatures(defaultforwarder.CoreFeatures))),
orchestratorimpl.Module(orchestratorimpl.NewDefaultParams()),
eventplatformfx.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()),
compressionfx.Module(),
nooptagger.Module(),
eventplatformreceiverimpl.Module(),
Expand Down Expand Up @@ -160,7 +160,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
aggregator.Bundle(demultiplexerimpl.NewDefaultParams()),
orchestratorimpl.Module(orchestratorimpl.NewDefaultParams()),
forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithFeatures(defaultforwarder.CoreFeatures))),
eventplatformfx.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()),
eventplatformreceiverimpl.Module(),
compressionfx.Module(),
nooptagger.Module(),
Expand Down
4 changes: 2 additions & 2 deletions cmd/cluster-agent-cloudfoundry/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (
workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformfxnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-noop"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
Expand Down Expand Up @@ -89,7 +89,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
compressionfx.Module(),
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()),
orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDisabledParams()),
eventplatformfxnoop.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()),
eventplatformreceiverimpl.Module(),

// setup workloadmeta
Expand Down
4 changes: 2 additions & 2 deletions cmd/cluster-agent/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import (
workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformfxnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-noop"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
Expand Down Expand Up @@ -141,7 +141,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
compressionfx.Module(),
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()),
orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDefaultParams()),
eventplatformfxnoop.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()),
eventplatformreceiverimpl.Module(),
// setup workloadmeta
wmcatalog.GetCatalog(),
Expand Down
4 changes: 2 additions & 2 deletions cmd/dogstatsd/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
dogstatsdServer "github.com/DataDog/datadog-agent/comp/dogstatsd/server"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformfxnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-noop"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentfx "github.com/DataDog/datadog-agent/comp/haagent/fx"
Expand Down Expand Up @@ -149,7 +149,7 @@ func RunDogstatsdFct(cliParams *CLIParams, defaultConfPath string, defaultLogFil
)),
secretsimpl.Module(),
orchestratorForwarderImpl.Module(orchestratorForwarderImpl.NewDisabledParams()),
eventplatformfxnoop.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDisabledParams()),
eventplatformreceiverimpl.Module(),
hostnameimpl.Module(),
localTaggerfx.Module(tagger.Params{}),
Expand Down
4 changes: 2 additions & 2 deletions cmd/process-agent/command/main_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx"
compstatsd "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd"
eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
hostMetadataUtils "github.com/DataDog/datadog-agent/comp/metadata/host/hostimpl/utils"
"github.com/DataDog/datadog-agent/comp/networkpath"
Expand Down Expand Up @@ -134,7 +134,7 @@ func runApp(ctx context.Context, globalParams *GlobalParams) error {
process.Bundle(),

eventplatformreceiverimpl.Module(),
eventplatformfx.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()),

// Provides the rdnssquerier module
rdnsquerierfx.Module(),
Expand Down
4 changes: 2 additions & 2 deletions cmd/process-agent/subcommands/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx"
eventplatformfx "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatformreceiver/eventplatformreceiverimpl"
hostMetadataUtils "github.com/DataDog/datadog-agent/comp/metadata/host/hostimpl/utils"
"github.com/DataDog/datadog-agent/comp/networkpath/npcollector"
Expand Down Expand Up @@ -127,7 +127,7 @@ func MakeCommand(globalParamsGetter func() *command.GlobalParams, name string, a

// Provide eventplatformimpl module
eventplatformreceiverimpl.Module(),
eventplatformfx.Module(),
eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()),

// Provide rdnsquerier module
rdnsquerierfx.Module(),
Expand Down
3 changes: 2 additions & 1 deletion cmd/serverless-init/metric/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer"
"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl"
"github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl"
log "github.com/DataDog/datadog-agent/comp/core/log/def"
logmock "github.com/DataDog/datadog-agent/comp/core/log/mock"
compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock"
Expand Down Expand Up @@ -64,5 +65,5 @@ func TestAddShutdownMetric(t *testing.T) {
}

func createDemultiplexer(t *testing.T) demultiplexer.FakeSamplerMock {
return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule())
return fxutil.Test[demultiplexer.FakeSamplerMock](t, fx.Provide(func() log.Component { return logmock.New(t) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule())
}
4 changes: 2 additions & 2 deletions comp/agent/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
workloadmetafxmock "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx-mock"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
Expand All @@ -27,7 +27,7 @@ func TestBundleDependencies(t *testing.T) {
compressionmock.MockModule(),
defaultforwarder.MockModule(),
orchestratorimpl.MockModule(),
eventplatformmock.MockModule(),
eventplatformimpl.MockModule(),
demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()),
workloadmetafxmock.MockModule(workloadmeta.NewParams()),
)
Expand Down
4 changes: 2 additions & 2 deletions comp/aggregator/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/DataDog/datadog-agent/comp/core"
nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/fx-noop"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock"
compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock"
Expand All @@ -25,7 +25,7 @@ func TestBundleDependencies(t *testing.T) {
compressionmock.MockModule(),
defaultforwarder.MockModule(),
orchestratorForwarderImpl.MockModule(),
eventplatformmock.MockModule(),
eventplatformimpl.MockModule(),
nooptagger.Module(),
haagentmock.Module(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/DataDog/datadog-agent/comp/core/status"
tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform"
orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
haagent "github.com/DataDog/datadog-agent/comp/haagent/def"
compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"go.uber.org/fx"

demultiplexerComp "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer"
"github.com/DataDog/datadog-agent/comp/core/hostname"
log "github.com/DataDog/datadog-agent/comp/core/log/def"
compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def"
"github.com/DataDog/datadog-agent/pkg/aggregator"
Expand All @@ -34,6 +35,7 @@ type fakeSamplerMockDependencies struct {
fx.In
Lc fx.Lifecycle
Log log.Component
Hostname hostname.Component
Compressor compression.Component
}

Expand All @@ -54,7 +56,7 @@ func (f *fakeSamplerMock) Stop(flush bool) {
}

func newFakeSamplerMock(deps fakeSamplerMockDependencies) demultiplexerComp.FakeSamplerMock {
demux := initTestAgentDemultiplexerWithFlushInterval(deps.Log, deps.Compressor, time.Hour)
demux := initTestAgentDemultiplexerWithFlushInterval(deps.Log, deps.Hostname, deps.Compressor, time.Hour)
mock := &fakeSamplerMock{
TestAgentDemultiplexer: demux,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
taggerMock "github.com/DataDog/datadog-agent/comp/core/tagger/mock"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformmock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/fx-mock"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
"github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock"
compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock"
Expand Down Expand Up @@ -64,7 +64,7 @@ func TestStatusOutPut(t *testing.T) {
defaultforwarder.MockModule(),
haagentmock.Module(),
orchestratorimpl.MockModule(),
eventplatformmock.MockModule(),
eventplatformimpl.MockModule(),
fx.Provide(func() tagger.Component {
return mockTagger
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import (
"sync"
"time"

"github.com/DataDog/datadog-agent/comp/core/hostname"
log "github.com/DataDog/datadog-agent/comp/core/log/def"
noopimpl "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def"
eventplatformock "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/mock"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock"
compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def"
"github.com/DataDog/datadog-agent/pkg/aggregator"
Expand Down Expand Up @@ -67,7 +68,7 @@ func (a *TestAgentDemultiplexer) AggregateSample(sample metrics.MetricSample) {
}

// GetEventPlatformForwarder returns a event platform forwarder
func (a *TestAgentDemultiplexer) GetEventPlatformForwarder() eventplatform.Component {
func (a *TestAgentDemultiplexer) GetEventPlatformForwarder() (eventplatform.Forwarder, error) {
return a.AgentDemultiplexer.GetEventPlatformForwarder()
}

Expand Down Expand Up @@ -175,7 +176,7 @@ func (a *TestAgentDemultiplexer) Reset() {
}

// initTestAgentDemultiplexerWithFlushInterval inits a TestAgentDemultiplexer with the given flush interval.
func initTestAgentDemultiplexerWithFlushInterval(log log.Component, compressor compression.Component, flushInterval time.Duration) *TestAgentDemultiplexer {
func initTestAgentDemultiplexerWithFlushInterval(log log.Component, hostname hostname.Component, compressor compression.Component, flushInterval time.Duration) *TestAgentDemultiplexer {
opts := aggregator.DefaultAgentDemultiplexerOptions()
opts.FlushInterval = flushInterval
opts.DontStartForwarders = true
Expand All @@ -184,7 +185,7 @@ func initTestAgentDemultiplexerWithFlushInterval(log log.Component, compressor c
sharedForwarderOptions := defaultforwarder.NewOptions(pkgconfigsetup.Datadog(), log, nil)
sharedForwarder := defaultforwarder.NewDefaultForwarder(pkgconfigsetup.Datadog(), log, sharedForwarderOptions)
orchestratorForwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{})
eventPlatformForwarder := eventplatformock.NewMock()
eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(hostname))
demux := aggregator.InitAndStartAgentDemultiplexer(log, sharedForwarder, &orchestratorForwarder, opts, eventPlatformForwarder, haagentmock.NewMockHaAgent(), compressor, noopimpl.NewComponent(), "hostname")
return NewTestAgentDemultiplexer(demux)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (
log "github.com/DataDog/datadog-agent/comp/core/log/def"
tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
eventplatformnoop "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/impl-noop"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform"
"github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/eventplatformimpl"
haagent "github.com/DataDog/datadog-agent/comp/haagent/def"
compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def"
"github.com/DataDog/datadog-agent/pkg/aggregator"
Expand Down Expand Up @@ -73,7 +74,7 @@ func (sender *diagnoseSenderManager) LazyGetSenderManager() (sender.SenderManage
haAgent := sender.deps.HaAgent
forwarder := defaultforwarder.NewDefaultForwarder(config, log, defaultforwarder.NewOptions(config, log, nil))
orchestratorForwarder := optional.NewOptionPtr[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{})
eventPlatformForwarder := eventplatformnoop.NewComponent()
eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(sender.deps.Hostname))
senderManager = aggregator.InitAndStartAgentDemultiplexer(
log,
forwarder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer"
"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl"
"github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl"
"github.com/DataDog/datadog-agent/pkg/aggregator/sender"
"github.com/DataDog/datadog-agent/pkg/collector/check/stub"
"github.com/DataDog/datadog-agent/pkg/metrics"
Expand Down Expand Up @@ -81,7 +82,7 @@ func (s *SenderManagerProxy) GetDefaultSender() (sender.Sender, error) {
}

func (suite *CollectorDemuxTestSuite) SetupTest() {
suite.demux = fxutil.Test[demultiplexer.FakeSamplerMock](suite.T(), fx.Provide(func() log.Component { return logmock.New(suite.T()) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule())
suite.demux = fxutil.Test[demultiplexer.FakeSamplerMock](suite.T(), fx.Provide(func() log.Component { return logmock.New(suite.T()) }), compressionmock.MockModule(), demultiplexerimpl.FakeSamplerMockModule(), hostnameimpl.MockModule())
suite.SenderManagerMock = NewSenderManagerMock(suite.demux)
suite.c = newCollector(fxutil.Test[dependencies](suite.T(),
core.MockBundle(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ const (
EventTypeServiceDiscovery = "service-discovery"
)

//go:generate mockgen -source=../def/$GOFILE -package=mock -destination=../mock/epforwarder_mockgen.go

// Component is the interface of the event platform forwarder component.
type Component interface {
// Get the forwarder instance if it exists.
Get() (Forwarder, bool)
}

// Forwarder is the interface of the event platform forwarder.
type Forwarder interface {
SendEventPlatformEvent(e *message.Message, eventType string) error
SendEventPlatformEventBlocking(e *message.Message, eventType string) error
Purge() map[string][]*message.Message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2023-present Datadog, Inc.

// Package mock provides the mock interafce for the event platform component.
package mock
//go:build test

import eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def"
package eventplatform

// Mock implements mock-specific methods.
type Mock interface {
eventplatform.Component
Component
}
Loading

0 comments on commit b80f86c

Please sign in to comment.