Documentation ¶
Index ¶
- func ConnectionPoolTestCases() ...
- func MockMessageMerger(old interface{}, new interface{}) interface{}
- func MustGenerateTestTLSConf(t *testing.T, ctx context.Context) (func() (*tls.Config, error), *tls.Dialer)
- func MustSetupInsecureControlPair(t *testing.T) (context.Context, control.Service, context.Context, control.Service)
- func MustSetupInsecureControlWithPool(t *testing.T, ctx context.Context, ...) (*network.ControlServer, reconciler.ControlPlaneConnectionPool)
- func MustSetupSecureControlPair(t *testing.T) (context.Context, control.Service, context.Context, control.Service)
- func MustSetupSecureControlWithPool(t *testing.T, ctx context.Context, ...) (*network.ControlServer, reconciler.ControlPlaneConnectionPool)
- func ParseMockMessage(bytes []byte) (interface{}, error)
- func SendReceiveTest(t *testing.T, sender control.Service, receiver control.Service)
- type ConnectionMock
- func (c *ConnectionMock) Errors() <-chan error
- func (c *ConnectionMock) PushInboundMessage(msg *control.Message)
- func (c *ConnectionMock) ReadMessage() *control.Message
- func (c *ConnectionMock) WaitAtLeastOneOutboundMessage() []*control.Message
- func (c *ConnectionMock) WriteMessage(msg *control.Message)
- type MockPayload
- type MockTLSDialerFactory
- type ServiceMock
- func (s *ServiceMock) AckIt(code control.OpCode)
- func (s *ServiceMock) ErrorHandler(handler control.ErrorHandler)
- func (s *ServiceMock) InvokeErrorHandler(ctx context.Context, err error)
- func (s *ServiceMock) InvokeMessageHandler(ctx context.Context, message *control.Message) bool
- func (s *ServiceMock) InvokeMessageHandlerWithErr(ctx context.Context, message *control.Message) error
- func (s *ServiceMock) MessageHandler(handler control.MessageHandler)
- func (s *ServiceMock) SendAndWaitForAck(opcode control.OpCode, payload encoding.BinaryMarshaler) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectionPoolTestCases ¶
func ConnectionPoolTestCases() map[string]func(t *testing.T, ctx context.Context, opts ...reconciler.ControlPlaneConnectionPoolOption) (*network.ControlServer, reconciler.ControlPlaneConnectionPool)
func MockMessageMerger ¶
func MockMessageMerger(old interface{}, new interface{}) interface{}
func MustGenerateTestTLSConf ¶
func MustSetupInsecureControlPair ¶
func MustSetupInsecureControlPair(t *testing.T) (context.Context, control.Service, context.Context, control.Service)
MustSetupInsecureControlPair setup a plain connection with a server and a client
func MustSetupInsecureControlWithPool ¶
func MustSetupInsecureControlWithPool(t *testing.T, ctx context.Context, opts ...reconciler.ControlPlaneConnectionPoolOption) (*network.ControlServer, reconciler.ControlPlaneConnectionPool)
func MustSetupSecureControlPair ¶
func MustSetupSecureControlPair(t *testing.T) (context.Context, control.Service, context.Context, control.Service)
MustSetupSecureControlPair setup a server and a client using tls
func MustSetupSecureControlWithPool ¶
func MustSetupSecureControlWithPool(t *testing.T, ctx context.Context, opts ...reconciler.ControlPlaneConnectionPoolOption) (*network.ControlServer, reconciler.ControlPlaneConnectionPool)
func ParseMockMessage ¶
Types ¶
type ConnectionMock ¶
type ConnectionMock struct { ErrorsCh chan error // contains filtered or unexported fields }
func NewConnectionMock ¶
func NewConnectionMock() *ConnectionMock
func (*ConnectionMock) Errors ¶
func (c *ConnectionMock) Errors() <-chan error
func (*ConnectionMock) PushInboundMessage ¶
func (c *ConnectionMock) PushInboundMessage(msg *control.Message)
func (*ConnectionMock) ReadMessage ¶
func (c *ConnectionMock) ReadMessage() *control.Message
func (*ConnectionMock) WaitAtLeastOneOutboundMessage ¶
func (c *ConnectionMock) WaitAtLeastOneOutboundMessage() []*control.Message
func (*ConnectionMock) WriteMessage ¶
func (c *ConnectionMock) WriteMessage(msg *control.Message)
type MockPayload ¶
type MockPayload string
var SomeMockPayload MockPayload = "Hello world!"
func (MockPayload) MarshalBinary ¶
func (m MockPayload) MarshalBinary() (data []byte, err error)
func (*MockPayload) UnmarshalBinary ¶
func (m *MockPayload) UnmarshalBinary(data []byte) error
type MockTLSDialerFactory ¶
func (*MockTLSDialerFactory) GenerateTLSDialer ¶
type ServiceMock ¶
type ServiceMock struct {
// contains filtered or unexported fields
}
func NewServiceMock ¶
func NewServiceMock() *ServiceMock
func (*ServiceMock) AckIt ¶
func (s *ServiceMock) AckIt(code control.OpCode)
AckIt propagates the ack for the last message sent using the provided opcode
func (*ServiceMock) ErrorHandler ¶
func (s *ServiceMock) ErrorHandler(handler control.ErrorHandler)
func (*ServiceMock) InvokeErrorHandler ¶
func (s *ServiceMock) InvokeErrorHandler(ctx context.Context, err error)
func (*ServiceMock) InvokeMessageHandler ¶
InvokeMessageHandler invokes the registered message handler and returns true if the message was acked back
func (*ServiceMock) InvokeMessageHandlerWithErr ¶
func (s *ServiceMock) InvokeMessageHandlerWithErr(ctx context.Context, message *control.Message) error
InvokeMessageHandlerWithErr invokes the registered message handler and returns the eventual error if the message was acked back with an error
func (*ServiceMock) MessageHandler ¶
func (s *ServiceMock) MessageHandler(handler control.MessageHandler)
func (*ServiceMock) SendAndWaitForAck ¶
func (s *ServiceMock) SendAndWaitForAck(opcode control.OpCode, payload encoding.BinaryMarshaler) error
Click to show internal directories.
Click to hide internal directories.