mbus

package
v0.0.0-...-88fc132 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confirmation

type Confirmation struct {
	MessageID string
}

func (Confirmation) String

func (c Confirmation) String() string

type Mbus

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

type Message

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

func (*Message) AddAttribute

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

type Option

type Option func(m *Message)

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

func (Options) Apply

func (o Options) Apply(message *Message)

type Service

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

func New

func New(mbus Mbus) *Service

func (*Service) Message

func (s *Service) Message(dest string, data interface{}, opts ...Option) *Message

func (*Service) Push

func (s *Service) Push(ctx context.Context, message *Message) (*Confirmation, error)

Jump to

Keyboard shortcuts

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