msg

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// Application or exchange specific fields,
	// the headers exchange will inspect this field.
	Headers lib.Table

	// Properties
	ContentType     string    // MIME content type
	ContentEncoding string    // MIME content encoding
	DeliveryMode    uint8     // Transient (0 or 1) or Persistent (2)
	Priority        uint8     // 0 to 9
	CorrelationId   string    // correlation identifier
	ReplyTo         string    // address to to reply to (ex: RPC)
	Expiration      string    // message expiration spec
	MessageId       string    // message identifier
	Timestamp       time.Time // message timestamp
	Type            string    // message type name
	UserId          string    // creating user id - ex: "guest"
	AppId           string    // creating application id

	// The application specific payload of the message
	Body []byte

	Channel *channels.Channel
}

Message struct

func NewMessage

func NewMessage(opts ...MsgOption) *Message

NewMessage New Message

type MsgOption

type MsgOption func(*Message)

MsgOption Msg Option

func WithOptionsBody

func WithOptionsBody(Body string) MsgOption

WithOptionsBody With Options Body

func WithOptionsChannel

func WithOptionsChannel(ch *channels.Channel) MsgOption

WithOptionsChannel With Options Channel

func WithOptionsDeliveryMode

func WithOptionsDeliveryMode(DeliveryMode uint8) MsgOption

WithOptionsDeliveryMode With Options Delivery Mode

type Ret

type Ret struct {
	Success    bool
	Data       string
	Exchange   string
	RoutingKey string
}

Ret struct

Jump to

Keyboard shortcuts

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