frame

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: Apache-2.0 Imports: 6 Imported by: 137

Documentation

Overview

The frame package contains constants associated with STOMP frames.

Keeping these constants in a separate package helps prevent the stomp package from getting to busy, as none of these constants are needed when calling the stomp package.

Index

Constants

View Source
const (
	AckAuto             = "auto"              // Client does not send ACK
	AckClient           = "client"            // Client sends ACK/NACK
	AckClientIndividual = "client-individual" // Client sends ACK/NACK for individual messages
)

Valid values for the "ack" header entry.

View Source
const (
	// Connect commands.
	CONNECT   = "CONNECT"
	STOMP     = "STOMP"
	CONNECTED = "CONNECTED"

	// Client commands.
	SEND        = "SEND"
	SUBSCRIBE   = "SUBSCRIBE"
	UNSUBSCRIBE = "UNSUBSCRIBE"
	ACK         = "ACK"
	NACK        = "NACK"
	BEGIN       = "BEGIN"
	COMMIT      = "COMMIT"
	ABORT       = "ABORT"
	DISCONNECT  = "DISCONNECT"

	// Server commands.
	MESSAGE = "MESSAGE"
	RECEIPT = "RECEIPT"
	ERROR   = "ERROR"
)

STOMP frame commands. Used upper case naming convention to avoid clashing with STOMP header names.

View Source
const (
	ContentLength = "content-length"
	ContentType   = "content-type"
	Receipt       = "receipt"
	AcceptVersion = "accept-version"
	Host          = "host"
	Version       = "version"
	Login         = "login"
	Passcode      = "passcode"
	HeartBeat     = "heart-beat"
	Session       = "session"
	Server        = "server"
	Destination   = "destination"
	Id            = "id"
	Ack           = "ack"
	Transaction   = "transaction"
	ReceiptId     = "receipt-id"
	Subscription  = "subscription"
	MessageId     = "message-id"
	Message       = "message"
)

STOMP header names. Some of the header names have commands with the same name (eg Ack, Message, Receipt). Commands use an upper-case naming convention, header names use pascal-case naming convention.

Variables

This section is empty.

Functions

func ParseHeartBeat

func ParseHeartBeat(heartBeat string) (time.Duration, time.Duration, error)

ParseHeartBeat parses the value of a STOMP heart-beat entry and returns two time durations. Returns an error if the heart-beat value is not in the correct format, or if the time durations are too big to be represented by the time.Duration type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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