testing

package
v0.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAsyncCommandNotificationStore

type MockAsyncCommandNotificationStore struct {
	mock.Mock
}

func (*MockAsyncCommandNotificationStore) CleanPodNotification

func (a *MockAsyncCommandNotificationStore) CleanPodNotification(srcName types.NamespacedName, pod string)

func (*MockAsyncCommandNotificationStore) CleanPodsNotifications

func (a *MockAsyncCommandNotificationStore) CleanPodsNotifications(srcName types.NamespacedName)

func (*MockAsyncCommandNotificationStore) GetCommandResult

func (*MockAsyncCommandNotificationStore) MessageHandler

type MockConnectionPool

type MockConnectionPool struct {
	mock.Mock
}

func (*MockConnectionPool) Close

func (c *MockConnectionPool) Close(ctx context.Context)

func (*MockConnectionPool) DialControlService

func (c *MockConnectionPool) DialControlService(ctx context.Context, key string, host string) (string, ctrl.Service, error)

func (*MockConnectionPool) GetConnectedHosts

func (c *MockConnectionPool) GetConnectedHosts(key string) []string

func (*MockConnectionPool) GetServices

func (c *MockConnectionPool) GetServices(key string) map[string]ctrl.Service

func (*MockConnectionPool) ReconcileConnections

func (c *MockConnectionPool) ReconcileConnections(ctx context.Context, key string, wantConnections []string, newServiceCb func(string, ctrl.Service), oldServiceCb func(string)) (map[string]ctrl.Service, error)

func (*MockConnectionPool) RemoveAllConnections

func (c *MockConnectionPool) RemoveAllConnections(ctx context.Context, key string)

func (*MockConnectionPool) RemoveConnection

func (c *MockConnectionPool) RemoveConnection(ctx context.Context, key string, host string)

func (*MockConnectionPool) ResolveControlInterface

func (c *MockConnectionPool) ResolveControlInterface(key string, host string) (string, ctrl.Service)

type MockServerHandler

type MockServerHandler struct {
	mock.Mock
	// Export the Router field so that tests can verify handlers in it directly
	Router  ctrlservice.MessageRouter
	Service *MockService
}

MockServerHandler is a mock of the ServerHandler that only stores results from AddAsyncHandler

func GetMockServerHandler

func GetMockServerHandler() *MockServerHandler

func (*MockServerHandler) AddAsyncHandler

func (s *MockServerHandler) AddAsyncHandler(opcode ctrl.OpCode, resultOpcode ctrl.OpCode, payloadType ctrlmessage.AsyncCommand,
	handler func(ctx context.Context, commandMessage ctrlservice.AsyncCommandMessage))

func (*MockServerHandler) AddSyncHandler

func (s *MockServerHandler) AddSyncHandler(opcode ctrl.OpCode, handler ctrl.MessageHandlerFunc)

func (*MockServerHandler) RemoveHandler

func (s *MockServerHandler) RemoveHandler(opcode ctrl.OpCode)

func (*MockServerHandler) Shutdown

func (s *MockServerHandler) Shutdown(timeout time.Duration)

type MockService

type MockService struct {
	mock.Mock
}

func (*MockService) ErrorHandler

func (s *MockService) ErrorHandler(handler ctrl.ErrorHandler)

func (*MockService) MessageHandler

func (s *MockService) MessageHandler(handler ctrl.MessageHandler)

func (*MockService) SendAndWaitForAck

func (s *MockService) SendAndWaitForAck(opcode ctrl.OpCode, payload encoding.BinaryMarshaler) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL