Skip to content

Commit

Permalink
- dummy provider
Browse files Browse the repository at this point in the history
dummy provider
  • Loading branch information
oke11o authored and root committed Jul 25, 2023
1 parent 4d62339 commit 4eab77d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "-"

Expand Down
4 changes: 4 additions & 0 deletions core/import/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions core/provider/dummy.go
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 4eab77d

Please sign in to comment.