Documentation ¶
Index ¶
- func NewBuildContext(t testing.TB) operator.BuildContext
- func NewTempDir(t testing.TB) string
- func NewTestDatabase(t testing.TB) *bbolt.DB
- 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([]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 MockOperator
- func (o *MockOperator) CanOutput() bool
- func (o *MockOperator) CanProcess() bool
- func (o *MockOperator) GetOutputIDs() []string
- func (o *MockOperator) ID() string
- func (o *MockOperator) Logger() *zap.SugaredLogger
- func (o *MockOperator) Outputs() []operator.Operator
- func (o *MockOperator) Process(ctx context.Context, e *entry.Entry) error
- func (o *MockOperator) SetOutputIDs(ids []string)
- func (o *MockOperator) SetOutputs(operators []operator.Operator) error
- func (o *MockOperator) Start(p operator.Persister) error
- func (o *MockOperator) Stop() error
- func (o *MockOperator) Type() string
- type MockPersister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBuildContext ¶
func NewBuildContext(t testing.TB) operator.BuildContext
NewBuildContext will return a new build context for testing
func NewTempDir ¶
NewTempDir will return a new temp directory for testing
func NewTestDatabase ¶
NewTestDatabase will return a new database 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 entry
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
GetOutputIDs returns the list of connected outputs.
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([]string)
SetOutputIDs will set the connected outputs' IDs.
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 MockOperator ¶
MockOperator is an autogenerated mock type for the MockOperator type
func NewMockOperator ¶
func NewMockOperator(id string) *MockOperator
NewMockOperator will return a basic operator mock
func (*MockOperator) CanOutput ¶
func (o *MockOperator) CanOutput() bool
CanOutput indicates if the operator will output entries to other operators.
func (*MockOperator) CanProcess ¶
func (o *MockOperator) CanProcess() bool
CanProcess indicates if the operator will process entries from other operators.
func (*MockOperator) GetOutputIDs ¶
func (o *MockOperator) GetOutputIDs() []string
GetOutputIDs returns the list of connected outputs.
func (*MockOperator) Logger ¶
func (o *MockOperator) Logger() *zap.SugaredLogger
Logger returns the operator's logger
func (*MockOperator) Outputs ¶
func (o *MockOperator) Outputs() []operator.Operator
Outputs returns the list of connected outputs.
func (*MockOperator) SetOutputIDs ¶
func (o *MockOperator) SetOutputIDs(ids []string)
SetOutputIDs will set the connected outputs' IDs.
func (*MockOperator) SetOutputs ¶
func (o *MockOperator) SetOutputs(operators []operator.Operator) error
SetOutputs will set the connected outputs.
func (*MockOperator) Start ¶
func (o *MockOperator) Start(p operator.Persister) error
Start will start the operator.
func (*MockOperator) Type ¶
func (o *MockOperator) Type() string
Type returns the type of the operator.