From 4eab77d551fb662a6ac069d5c69efa6c372745b5 Mon Sep 17 00:00:00 2001 From: sabevzenko Date: Tue, 25 Jul 2023 19:05:21 +0300 Subject: [PATCH] - dummy provider dummy provider --- cli/cli.go | 2 +- core/import/import.go | 4 ++++ core/provider/dummy.go | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 core/provider/dummy.go diff --git a/cli/cli.go b/cli/cli.go index d38fd27af..6befa3ec0 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -24,7 +24,7 @@ import ( "go.uber.org/zap/zapcore" ) -const Version = "0.5.7" +const Version = "0.5.8" const defaultConfigFile = "load" const stdinConfigSelector = "-" diff --git a/core/import/import.go b/core/import/import.go index 044f4745e..8397bcad3 100644 --- a/core/import/import.go +++ b/core/import/import.go @@ -74,6 +74,10 @@ func Import(fs afero.Fs) { // type that you need, but untyped map. RegisterCustomJSONProvider("json", func() core.Ammo { return map[string]interface{}{} }) + register.Provider("dummy", func() core.Provider { + return provider.Dummy{} + }) + register.Aggregator("phout", func(conf netsample.PhoutConfig) (core.Aggregator, error) { a, err := netsample.NewPhout(fs, conf) return netsample.WrapAggregator(a), err diff --git a/core/provider/dummy.go b/core/provider/dummy.go new file mode 100644 index 000000000..bf127d3fa --- /dev/null +++ b/core/provider/dummy.go @@ -0,0 +1,22 @@ +package provider + +import ( + "context" + + "github.com/yandex/pandora/core" +) + +type Dummy struct { +} + +func (d Dummy) Run(context.Context, core.ProviderDeps) error { + return nil +} + +func (d Dummy) Acquire() (ammo core.Ammo, ok bool) { + return nil, true +} + +func (d Dummy) Release(core.Ammo) {} + +var _ core.Provider = (*Dummy)(nil)