mock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockMessageBus

type MockMessageBus struct {
	Messages []string
	// contains filtered or unexported fields
}

MockMessageBus is a mock that implements the Messagebus interface.

For now, it doesn't do anything with the queue name. All messages sent are appended to the Messages slice.

func NewMockMessageBus

func NewMockMessageBus() *MockMessageBus

NewMockMessageBus creates a new MockMessageBus instance

func (*MockMessageBus) AddQueueMessage

func (mb *MockMessageBus) AddQueueMessage(queue string, msg string)

AddQueueMessage adds a message to a specific queue (for test setup)

func (*MockMessageBus) Close

func (mb *MockMessageBus) Close() error

func (*MockMessageBus) GetMessages

func (mb *MockMessageBus) GetMessages(queue string) []string

GetMessages returns messages sent to a specific queue

func (*MockMessageBus) ReceiveMessage

func (mb *MockMessageBus) ReceiveMessage(message chan<- string, queue string) (messagebus.Subscription, error)

func (*MockMessageBus) SendMessage

func (mb *MockMessageBus) SendMessage(message []byte, queue string) error

func (*MockMessageBus) SendMessageWithHeaders

func (mb *MockMessageBus) SendMessageWithHeaders(message []byte, queue string, headers map[string]string) error

func (*MockMessageBus) SetReplyMessage

func (mb *MockMessageBus) SetReplyMessage(msg string)

SetReplyMessage is deprecated - use SetReplyPayload instead

func (*MockMessageBus) SetReplyPayload

func (mb *MockMessageBus) SetReplyPayload(payload any)

SetReplyPayload sets the payload that will be used to reply to requests

func (*MockMessageBus) SetSendError

func (mb *MockMessageBus) SetSendError(err error)

SetSendError sets an error to be returned by SendMessage

type MockSubscription

type MockSubscription struct {
	// contains filtered or unexported fields
}

func (MockSubscription) Close

func (ms MockSubscription) Close() error

Jump to

Keyboard shortcuts

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