mbus

package
v0.0.0-...-89f1db5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 1 Imported by: 2

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