message

package
v0.0.0-...-6edac6f Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMarshaler

func SetMarshaler(fn Marshaler)

func SetUUIDGenerator

func SetUUIDGenerator(fn UUIDGenerator)

func SetUnmarshaler

func SetUnmarshaler(fn Unmarshaler)

Types

type Envelope

type Envelope []byte

func NewEnvelope

func NewEnvelope(msg *Message) (Envelope, error)

func (Envelope) Copy

func (e Envelope) Copy() Envelope

func (Envelope) Unmarshal

func (e Envelope) Unmarshal() (*Message, error)

type Marshaler

type Marshaler func(*Message) (Envelope, error)

type Message

type Message struct {
	ID       uuid.UUID
	Metadata map[string]string
	Event    *event.Event
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(evt *event.Event, opts ...MessageOption) *Message

func (*Message) Envelope

func (msg *Message) Envelope() (Envelope, error)

type MessageOption

type MessageOption func(*Message)

func SetMetadata

func SetMetadata(meta map[string]string) MessageOption

func WithMetadata

func WithMetadata(k, v string) MessageOption

type Path

type Path struct {
	Topic   string
	Channel string
	Broker  string
}

type UUIDGenerator

type UUIDGenerator func() uuid.UUID

type Unmarshaler

type Unmarshaler func([]byte) (*Message, error)

Jump to

Keyboard shortcuts

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