Documentation
¶
Index ¶
- Constants
- type AuthBasic
- type AuthMTLS
- type ConnectionPool
- type ConnectionPoolMock
- type Message
- type Provider
- type ProviderMock
- func (mock *ProviderMock) Direction() string
- func (mock *ProviderMock) DirectionCalls() []struct{}
- func (mock *ProviderMock) Listen() (<-chan *Message, error)
- func (mock *ProviderMock) ListenCalls() []struct{}
- func (mock *ProviderMock) Name() string
- func (mock *ProviderMock) NameCalls() []struct{}
- func (mock *ProviderMock) Publish(in1 Message) (Message, error)
- func (mock *ProviderMock) PublishCalls() []struct{ ... }
- func (mock *ProviderMock) Setup() error
- func (mock *ProviderMock) SetupCalls() []struct{}
- func (mock *ProviderMock) Stop() error
- func (mock *ProviderMock) StopCalls() []struct{}
- func (mock *ProviderMock) Type() string
- func (mock *ProviderMock) TypeCalls() []struct{}
- type TLS
Constants ¶
const ( DirectionInput = "input" DirectionOutput = "output" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionPool ¶
type ConnectionPool interface { }
type ConnectionPoolMock ¶
type ConnectionPoolMock struct {
// contains filtered or unexported fields
}
ConnectionPoolMock is a mock implementation of ConnectionPool.
func TestSomethingThatUsesConnectionPool(t *testing.T) { // make and configure a mocked ConnectionPool mockedConnectionPool := &ConnectionPoolMock{ } // TODO: use mockedConnectionPool in code that requires ConnectionPool // and then make assertions. }
type Message ¶
type Message struct { // ID is a random message ID ID string // ParentID allows a message to be traced through a pipeline, actions, success and fail messages // will have the a parent ID equal to the recieved message ID ParentID string // Data is an arbitrary data payload for the message Data []byte // ContentType for the message if known ContentType string // Timestamp for the message nanoseconds since 1970 Timestamp int64 // Redelivered is set if this message is a re-delivery Redelivered bool // Sequence number for the message Sequence uint64 // Metadata contains miscellanious information information Metadata map[string]string }
func NewMessage ¶
func NewMessage() Message
type Provider ¶
type Provider interface { Name() string Type() string // Type returns the type of the provider Direction() string // Direction returns input or output Setup() error // Setup to initalize any connection for the provider Listen() (<-chan *Message, error) // Listen for messages Publish(Message) (Message, error) // Publish a message to the outbound provider Stop() error // Stop listening for messages }
Provider defines a generic interface than an input or an output must implement
type ProviderMock ¶
type ProviderMock struct { // DirectionFunc mocks the Direction method. DirectionFunc func() string // ListenFunc mocks the Listen method. ListenFunc func() (<-chan *Message, error) // NameFunc mocks the Name method. NameFunc func() string // PublishFunc mocks the Publish method. PublishFunc func(in1 Message) (Message, error) // SetupFunc mocks the Setup method. SetupFunc func() error // StopFunc mocks the Stop method. StopFunc func() error // TypeFunc mocks the Type method. TypeFunc func() string // contains filtered or unexported fields }
ProviderMock is a mock implementation of Provider.
func TestSomethingThatUsesProvider(t *testing.T) { // make and configure a mocked Provider mockedProvider := &ProviderMock{ DirectionFunc: func() string { panic("TODO: mock out the Direction method") }, ListenFunc: func() (<-chan *Message, error) { panic("TODO: mock out the Listen method") }, NameFunc: func() string { panic("TODO: mock out the Name method") }, PublishFunc: func(in1 Message) (Message, error) { panic("TODO: mock out the Publish method") }, SetupFunc: func() error { panic("TODO: mock out the Setup method") }, StopFunc: func() error { panic("TODO: mock out the Stop method") }, TypeFunc: func() string { panic("TODO: mock out the Type method") }, } // TODO: use mockedProvider in code that requires Provider // and then make assertions. }
func (*ProviderMock) Direction ¶
func (mock *ProviderMock) Direction() string
Direction calls DirectionFunc.
func (*ProviderMock) DirectionCalls ¶
func (mock *ProviderMock) DirectionCalls() []struct { }
DirectionCalls gets all the calls that were made to Direction. Check the length with:
len(mockedProvider.DirectionCalls())
func (*ProviderMock) Listen ¶
func (mock *ProviderMock) Listen() (<-chan *Message, error)
Listen calls ListenFunc.
func (*ProviderMock) ListenCalls ¶
func (mock *ProviderMock) ListenCalls() []struct { }
ListenCalls gets all the calls that were made to Listen. Check the length with:
len(mockedProvider.ListenCalls())
func (*ProviderMock) NameCalls ¶
func (mock *ProviderMock) NameCalls() []struct { }
NameCalls gets all the calls that were made to Name. Check the length with:
len(mockedProvider.NameCalls())
func (*ProviderMock) Publish ¶
func (mock *ProviderMock) Publish(in1 Message) (Message, error)
Publish calls PublishFunc.
func (*ProviderMock) PublishCalls ¶
func (mock *ProviderMock) PublishCalls() []struct { In1 Message }
PublishCalls gets all the calls that were made to Publish. Check the length with:
len(mockedProvider.PublishCalls())
func (*ProviderMock) SetupCalls ¶
func (mock *ProviderMock) SetupCalls() []struct { }
SetupCalls gets all the calls that were made to Setup. Check the length with:
len(mockedProvider.SetupCalls())
func (*ProviderMock) StopCalls ¶
func (mock *ProviderMock) StopCalls() []struct { }
StopCalls gets all the calls that were made to Stop. Check the length with:
len(mockedProvider.StopCalls())
func (*ProviderMock) TypeCalls ¶
func (mock *ProviderMock) TypeCalls() []struct { }
TypeCalls gets all the calls that were made to Type. Check the length with:
len(mockedProvider.TypeCalls())