Documentation ¶
Index ¶
- type Hasher
- type HasherMock
- type InvalidConfigError
- type NewSenderer
- type NewSendererMock
- func (mock *NewSendererMock) NewSender(tid tenant.Id, plugin string, name string, config interface{}, ...) (Sender, error)
- func (mock *NewSendererMock) NewSenderCalls() []struct{ ... }
- func (mock *NewSendererMock) SenderHash(config interface{}) (string, error)
- func (mock *NewSendererMock) SenderHashCalls() []struct{ ... }
- type Sender
- type SenderMock
- func (mock *SenderMock) Config() interface{}
- func (mock *SenderMock) ConfigCalls() []struct{}
- func (mock *SenderMock) EventErrorCount() int
- func (mock *SenderMock) EventErrorVelocity() int
- func (mock *SenderMock) EventSuccessCount() int
- func (mock *SenderMock) EventSuccessVelocity() int
- func (mock *SenderMock) EventTs() int64
- func (mock *SenderMock) Name() string
- func (mock *SenderMock) NameCalls() []struct{}
- func (mock *SenderMock) Plugin() string
- func (mock *SenderMock) PluginCalls() []struct{}
- func (mock *SenderMock) Send(e event.Event)
- func (mock *SenderMock) SendCalls() []struct{ ... }
- func (mock *SenderMock) StopSending(ctx context.Context)
- func (mock *SenderMock) StopSendingCalls() []struct{ ... }
- func (mock *SenderMock) Tenant() tenant.Id
- func (mock *SenderMock) TenantCalls() []struct{}
- func (mock *SenderMock) Unwrap() Sender
- func (mock *SenderMock) UnwrapCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HasherMock ¶
type HasherMock struct { // SenderHashFunc mocks the SenderHash method. SenderHashFunc func(config interface{}) (string, error) // contains filtered or unexported fields }
HasherMock is a mock implementation of Hasher.
func TestSomethingThatUsesHasher(t *testing.T) { // make and configure a mocked Hasher mockedHasher := &HasherMock{ SenderHashFunc: func(config interface{}) (string, error) { panic("mock out the SenderHash method") }, } // use mockedHasher in code that requires Hasher // and then make assertions. }
func (*HasherMock) SenderHash ¶
func (mock *HasherMock) SenderHash(config interface{}) (string, error)
SenderHash calls SenderHashFunc.
func (*HasherMock) SenderHashCalls ¶
func (mock *HasherMock) SenderHashCalls() []struct { Config interface{} }
SenderHashCalls gets all the calls that were made to SenderHash. Check the length with:
len(mockedHasher.SenderHashCalls())
type InvalidConfigError ¶
type InvalidConfigError struct {
Err error
}
func (*InvalidConfigError) Error ¶
func (e *InvalidConfigError) Error() string
func (*InvalidConfigError) Unwrap ¶
func (e *InvalidConfigError) Unwrap() error
type NewSenderer ¶
type NewSendererMock ¶
type NewSendererMock struct { // NewSenderFunc mocks the NewSender method. NewSenderFunc func(tid tenant.Id, plugin string, name string, config interface{}, secrets secret.Vault, tableSyncer syncer.DeltaSyncer) (Sender, error) // SenderHashFunc mocks the SenderHash method. SenderHashFunc func(config interface{}) (string, error) // contains filtered or unexported fields }
NewSendererMock is a mock implementation of NewSenderer.
func TestSomethingThatUsesNewSenderer(t *testing.T) { // make and configure a mocked NewSenderer mockedNewSenderer := &NewSendererMock{ NewSenderFunc: func(tid tenant.Id, plugin string, name string, config interface{}, secrets secret.Vault) (Sender, error) { panic("mock out the NewSender method") }, SenderHashFunc: func(config interface{}) (string, error) { panic("mock out the SenderHash method") }, } // use mockedNewSenderer in code that requires NewSenderer // and then make assertions. }
func (*NewSendererMock) NewSender ¶
func (mock *NewSendererMock) NewSender(tid tenant.Id, plugin string, name string, config interface{}, secrets secret.Vault, tableSyncer syncer.DeltaSyncer) (Sender, error)
NewSender calls NewSenderFunc.
func (*NewSendererMock) NewSenderCalls ¶
func (mock *NewSendererMock) NewSenderCalls() []struct { Tid tenant.Id Plugin string Name string Config interface{} Secrets secret.Vault }
NewSenderCalls gets all the calls that were made to NewSender. Check the length with:
len(mockedNewSenderer.NewSenderCalls())
func (*NewSendererMock) SenderHash ¶
func (mock *NewSendererMock) SenderHash(config interface{}) (string, error)
SenderHash calls SenderHashFunc.
func (*NewSendererMock) SenderHashCalls ¶
func (mock *NewSendererMock) SenderHashCalls() []struct { Config interface{} }
SenderHashCalls gets all the calls that were made to SenderHash. Check the length with:
len(mockedNewSenderer.SenderHashCalls())
type Sender ¶
type Sender interface { // Send consumes and event and sends it to the target Send(e event.Event) // Unwrap Unwrap() Sender // StopSending will stop any long running maintenance threads in the sender plugin. // Often this function does nothing. StopSending(ctx context.Context) // Config() interface{} Name() string Plugin() string Tenant() tenant.Id EventSuccessCount() int EventSuccessVelocity() int EventErrorCount() int EventErrorVelocity() int EventTs() int64 }
or Outputter[√] or Producer[x] or Publisher[√]
type SenderMock ¶
type SenderMock struct { // ConfigFunc mocks the Config method. ConfigFunc func() interface{} // NameFunc mocks the Name method. NameFunc func() string // PluginFunc mocks the Plugin method. PluginFunc func() string // SendFunc mocks the Send method. SendFunc func(e event.Event) // StopSendingFunc mocks the StopSending method. StopSendingFunc func(ctx context.Context) // TenantFunc mocks the Tenant method. TenantFunc func() tenant.Id // UnwrapFunc mocks the Unwrap method. UnwrapFunc func() Sender // contains filtered or unexported fields }
SenderMock is a mock implementation of Sender.
func TestSomethingThatUsesSender(t *testing.T) { // make and configure a mocked Sender mockedSender := &SenderMock{ ConfigFunc: func() interface{} { panic("mock out the Config method") }, NameFunc: func() string { panic("mock out the Name method") }, PluginFunc: func() string { panic("mock out the Plugin method") }, SendFunc: func(e event.Event) { panic("mock out the Send method") }, StopSendingFunc: func(ctx context.Context) { panic("mock out the StopSending method") }, TenantFunc: func() tenant.Id { panic("mock out the Tenant method") }, UnwrapFunc: func() Sender { panic("mock out the Unwrap method") }, } // use mockedSender in code that requires Sender // and then make assertions. }
func (*SenderMock) Config ¶ added in v0.2.1
func (mock *SenderMock) Config() interface{}
Config calls ConfigFunc.
func (*SenderMock) ConfigCalls ¶ added in v0.2.1
func (mock *SenderMock) ConfigCalls() []struct { }
ConfigCalls gets all the calls that were made to Config. Check the length with:
len(mockedSender.ConfigCalls())
func (*SenderMock) EventErrorCount ¶ added in v1.1.2
func (mock *SenderMock) EventErrorCount() int
func (*SenderMock) EventErrorVelocity ¶ added in v1.1.2
func (mock *SenderMock) EventErrorVelocity() int
func (*SenderMock) EventSuccessCount ¶ added in v1.1.2
func (mock *SenderMock) EventSuccessCount() int
func (*SenderMock) EventSuccessVelocity ¶ added in v1.1.2
func (mock *SenderMock) EventSuccessVelocity() int
func (*SenderMock) EventTs ¶ added in v1.1.2
func (mock *SenderMock) EventTs() int64
func (*SenderMock) Name ¶ added in v0.2.1
func (mock *SenderMock) Name() string
Name calls NameFunc.
func (*SenderMock) NameCalls ¶ added in v0.2.1
func (mock *SenderMock) NameCalls() []struct { }
NameCalls gets all the calls that were made to Name. Check the length with:
len(mockedSender.NameCalls())
func (*SenderMock) Plugin ¶ added in v0.2.1
func (mock *SenderMock) Plugin() string
Plugin calls PluginFunc.
func (*SenderMock) PluginCalls ¶ added in v0.2.1
func (mock *SenderMock) PluginCalls() []struct { }
PluginCalls gets all the calls that were made to Plugin. Check the length with:
len(mockedSender.PluginCalls())
func (*SenderMock) SendCalls ¶
func (mock *SenderMock) SendCalls() []struct { E event.Event }
SendCalls gets all the calls that were made to Send. Check the length with:
len(mockedSender.SendCalls())
func (*SenderMock) StopSending ¶
func (mock *SenderMock) StopSending(ctx context.Context)
StopSending calls StopSendingFunc.
func (*SenderMock) StopSendingCalls ¶
func (mock *SenderMock) StopSendingCalls() []struct { Ctx context.Context }
StopSendingCalls gets all the calls that were made to StopSending. Check the length with:
len(mockedSender.StopSendingCalls())
func (*SenderMock) Tenant ¶ added in v0.3.0
func (mock *SenderMock) Tenant() tenant.Id
Tenant calls TenantFunc.
func (*SenderMock) TenantCalls ¶ added in v0.3.0
func (mock *SenderMock) TenantCalls() []struct { }
TenantCalls gets all the calls that were made to Tenant. Check the length with:
len(mockedSender.TenantCalls())
func (*SenderMock) UnwrapCalls ¶
func (mock *SenderMock) UnwrapCalls() []struct { }
UnwrapCalls gets all the calls that were made to Unwrap. Check the length with:
len(mockedSender.UnwrapCalls())