broker

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	// SetLogger set a logger that will log operations on broker controller
	SetLogger(logger log.Interface)

	// Publish a message to the broker
	Publish(ctx context.Context, channel string, mw Message) error

	// Subscribe to messages from the broker
	Subscribe(ctx context.Context, channel string) (msgs chan Message, stop chan interface{}, err error)

	// SetQueueName sets the name of the queue that will be used by the broker
	SetQueueName(name string)
}

Controller represents the functions that should be implemented to connect the broker to the application or the client

type Field

type Field string
const (
	// CorrelationIDField is the name of the field that will contain the correlation ID
	CorrelationIDField Field = "correlation_id"
)

func (Field) String

func (f Field) String() string

type Message

type Message struct {
	CorrelationID *string
	Payload       []byte
}

Message is a wrapper that will contain all information regarding a message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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