message

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Timestamp       int64               `json:"timestamp,omitempty"`
	MsgId           string              `json:"msg_id,omitempty"`
	ResponseChannel string              `json:"response_channel,omitempty"`
	Channel         string              `json:"channel,omitempty"`
	Route           string              `json:"route,omitempty"`
	From            string              `json:"from,omitempty"`
	To              string              `json:"to,omitempty"`
	Payload         interface{}         `json:"payload,omitempty"`
	Err             error               `json:"err,omitempty"`
	Meta            map[string][]string `json:"meta,omitempty"`
}

func FromNatsMsg

func FromNatsMsg(msg *nats.Msg) (*Message, error)

func FromNatsRequest

func FromNatsRequest(req micro.Request) (*Message, error)

func (*Message) JSON

func (m *Message) JSON() []byte

func (*Message) ToNatsMsg

func (m *Message) ToNatsMsg() (*nats.Msg, error)

Jump to

Keyboard shortcuts

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