Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockEventServer ¶
type MockEventServer struct { grpc.ServerStream AgentName string NumSent atomic.Uint32 NumRecv atomic.Uint32 Application v1alpha1.Application RecvHooks []RecvHook SendHooks []SendHook }
MockEventServer implements a mock for the SubscriptionServer stream used for testing.
func NewMockEventServer ¶
func NewMockEventServer() *MockEventServer
func (*MockEventServer) AddRecvHook ¶
func (s *MockEventServer) AddRecvHook(hook RecvHook)
func (*MockEventServer) AddSendHook ¶
func (s *MockEventServer) AddSendHook(hook SendHook)
func (*MockEventServer) Context ¶
func (s *MockEventServer) Context() context.Context
func (*MockEventServer) Recv ¶
func (s *MockEventServer) Recv() (*eventstreamapi.Event, error)
func (*MockEventServer) Send ¶
func (s *MockEventServer) Send(sub *eventstreamapi.Event) error
type RecvHook ¶
type RecvHook func(s *MockEventServer) error
RecvHook is a function that will be executed for the Recv call in the mock
type SendHook ¶
type SendHook func(s *MockEventServer, sub *eventstreamapi.Event) error
SendHook is a function that will be executed for the Send call in the mock
Click to show internal directories.
Click to hide internal directories.