mbus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package mbus holds reduced public message-bus contracts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confirmation

type Confirmation struct {
	MessageID string
}

Confirmation is the reduced delivery confirmation payload.

func (Confirmation) String

func (c Confirmation) String() string

type Message

type Message struct {
	ID         string
	Resource   string
	TraceID    string
	Attributes map[string]interface{}
	Subject    string
	Data       interface{}
}

Message is the reduced public message-bus payload contract.

func (*Message) AddAttribute

func (m *Message) AddAttribute(name string, value interface{})

type Option

type Option func(m *Message)

Option mutates a message before publish.

func WithAttribute

func WithAttribute(name string, value interface{}) Option

func WithID

func WithID(id string) Option

func WithSubject

func WithSubject(subject string) Option

func WithTraceID

func WithTraceID(traceID string) Option

type Options

type Options []Option

Options applies a message option list.

func (Options) Apply

func (o Options) Apply(message *Message)

type Service

type Service interface {
	Push(ctx context.Context, message *Message) (*Confirmation, error)
	Message(dest string, data interface{}, opts ...Option) *Message
}

Service is the reduced public message-bus contract.

Jump to

Keyboard shortcuts

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