Documentation ¶
Index ¶
- func Logger(t testing.TB) *zap.SugaredLogger
- func NewMockPersister(scope string) operator.Persister
- func NewUnscopedMockPersister() operator.Persister
- func Trim(s string) string
- type FakeOutput
- func (f *FakeOutput) CanOutput() bool
- func (f *FakeOutput) CanProcess() bool
- func (f *FakeOutput) ExpectBody(t testing.TB, body interface{})
- func (f *FakeOutput) ExpectEntry(t testing.TB, expected *entry.Entry)
- func (f *FakeOutput) ExpectNoEntry(t testing.TB, timeout time.Duration)
- func (f *FakeOutput) GetOutputIDs() []string
- func (f *FakeOutput) ID() string
- func (f *FakeOutput) Logger() *zap.SugaredLogger
- func (f *FakeOutput) Outputs() []operator.Operator
- func (f *FakeOutput) Process(ctx context.Context, entry *entry.Entry) error
- func (f *FakeOutput) SetOutputIDs(s []string)
- func (f *FakeOutput) SetOutputs(outputs []operator.Operator) error
- func (f *FakeOutput) Start(_ operator.Persister) error
- func (f *FakeOutput) Stop() error
- func (f *FakeOutput) Type() string
- type Operator
- func (_m *Operator) CanOutput() bool
- func (_m *Operator) CanProcess() bool
- func (_m *Operator) GetOutputIDs() []string
- func (_m *Operator) ID() string
- func (_m *Operator) Logger() *zap.SugaredLogger
- func (_m *Operator) Outputs() []operator.Operator
- func (_m *Operator) Process(_a0 context.Context, _a1 *entry.Entry) error
- func (_m *Operator) SetOutputIDs(_a0 []string)
- func (_m *Operator) SetOutputs(_a0 []operator.Operator) error
- func (_m *Operator) Start(_a0 operator.Persister) error
- func (_m *Operator) Stop() error
- func (_m *Operator) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockPersister ¶
NewMockPersister will return a new persister for testing
func NewUnscopedMockPersister ¶
NewUnscopedMockPersister will return a new persister for testing
Types ¶
type FakeOutput ¶
type FakeOutput struct { Received chan *entry.Entry *zap.SugaredLogger }
FakeOutput is an empty output used primarily for testing
func NewFakeOutput ¶
func NewFakeOutput(t testing.TB) *FakeOutput
NewFakeOutput creates a new fake output with default settings
func (*FakeOutput) CanOutput ¶
func (f *FakeOutput) CanOutput() bool
CanOutput always returns false for a fake output
func (*FakeOutput) CanProcess ¶
func (f *FakeOutput) CanProcess() bool
CanProcess always returns true for a fake output
func (*FakeOutput) ExpectBody ¶
func (f *FakeOutput) ExpectBody(t testing.TB, body interface{})
ExpectBody expects that a body will be received by the fake operator within a second and that it is equal to the given body
func (*FakeOutput) ExpectEntry ¶
func (f *FakeOutput) ExpectEntry(t testing.TB, expected *entry.Entry)
ExpectEntry expects that an entry will be received by the fake operator within a second and that it is equal to the given body
func (*FakeOutput) ExpectNoEntry ¶
func (f *FakeOutput) ExpectNoEntry(t testing.TB, timeout time.Duration)
ExpectNoEntry expects that no entry will be received within the specified time
func (*FakeOutput) GetOutputIDs ¶
func (f *FakeOutput) GetOutputIDs() []string
Outputs always returns nil for a fake output
func (*FakeOutput) ID ¶
func (f *FakeOutput) ID() string
ID always returns `fake` as the ID of a fake output operator
func (*FakeOutput) Logger ¶
func (f *FakeOutput) Logger() *zap.SugaredLogger
Logger returns the logger of a fake output
func (*FakeOutput) Outputs ¶
func (f *FakeOutput) Outputs() []operator.Operator
Outputs always returns nil for a fake output
func (*FakeOutput) Process ¶
Process will place all incoming entries on the Received channel of a fake output
func (*FakeOutput) SetOutputIDs ¶
func (f *FakeOutput) SetOutputIDs(s []string)
SetOutputIDs immediately returns nil for a fake output
func (*FakeOutput) SetOutputs ¶
func (f *FakeOutput) SetOutputs(outputs []operator.Operator) error
SetOutputs immediately returns nil for a fake output
func (*FakeOutput) Start ¶
func (f *FakeOutput) Start(_ operator.Persister) error
Start immediately returns nil for a fake output
func (*FakeOutput) Stop ¶
func (f *FakeOutput) Stop() error
Stop immediately returns nil for a fake output
func (*FakeOutput) Type ¶
func (f *FakeOutput) Type() string
Type always return `fake_output` for a fake output
type Operator ¶
Operator is an autogenerated mock type for the Operator type
func NewMockOperator ¶
NewMockOperator will return a basic operator mock
func (*Operator) CanProcess ¶
CanProcess provides a mock function with given fields:
func (*Operator) GetOutputIDs ¶
GetOutputIDs provides a mock function with given fields:
func (*Operator) Logger ¶
func (_m *Operator) Logger() *zap.SugaredLogger
Logger provides a mock function with given fields:
func (*Operator) SetOutputIDs ¶
SetOutputIDs provides a mock function with given fields: _a0
func (*Operator) SetOutputs ¶
SetOutputs provides a mock function with given fields: _a0