mock

package
v0.0.0-...-ab50414 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

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