Documentation ¶
Overview ¶
Package stompngo implements a STOMP 1.1+ compatible client library. For more STOMP information, see the specification at: http://stomp.github.com/.
Preparation ¶
Network Connect:
You are responsible for first establishing a network connection.
This network connection will be used when you create a stompngo.Connection to interact with the STOMP broker.
h := "localhost" p := "61613" n, err := net.Dial(stompngo.NetProtoTCP, net.JoinHostPort(h, p)) if err != nil { // Do something sane ... }
Shutdown ¶
Network Disconnect:
When processing is complete, you MUST close the network connection. If you fail to do this, you will leak goroutines!
err = n.Close() // Could be defered above, think about it! if err != nil { // Do something sane ... }
STOMP Frames ¶
The STOMP specification defines these physical frames that can be sent from a client to a STOMP broker:
CONNECT connect to a STOMP broker, any version. STOMP connect to a STOMP broker, specification version 1.1+ only. DISCONNECT disconnect from a STOMP broker. SEND Send a message to a named queue or topic. SUBSCRIBE Prepare to read messages from a named queue or topic. UNSUBSCRIBE Complete reading messages from a named queue or topic. ACK Acknowledge that a message has been received and processed. NACK Deny that a message has been received and processed, specification version 1.1+ only. BEGIN Begin a transaction. COMMIT Commit a transaction. ABORT Abort a transaction.
The STOMP specification defines these physical frames that a client can receive from a STOMP broker:
CONNECTED Broker response upon connection success. ERROR Broker emitted upon any error at any time during an active STOMP connection. MESSAGE A STOMP message frame, possibly with headers and a data payload. RECEIPT A receipt from the broker for a previous frame sent by the client.
Subscribe and MessageData Channels ¶
The Subscribe method returns a channel from which you receive MessageData values.
The channel returned has different characteristics depending on the Stomp Version, and the Headers you pass to Subscribe.
For details on Subscribe requirements and behavior, see: https://github.com/gmallard/stompngo/wiki/subscribe-and-messagedata
RECEIPTs ¶
Receipts are never received on a subscription unique MessageData channel.
They are always queued to the shared connection level stompgo.Connection.MessageData channel.
The reason for this behavior is because RECEIPT frames do not contain a subscription Header (per the STOMP specifications). See the:
https://github.com/gmallard/stompngo_examples
package for several examples.
Index ¶
- Constants
- Variables
- func HexData(b []uint8) string
- func Protocols() []string
- func Sha1(q string) string
- func Supported(v string) bool
- func Uuid() string
- func Version() string
- type CONNERROR
- type Connection
- func (c *Connection) Abort(h Headers) error
- func (c *Connection) Ack(h Headers) error
- func (c *Connection) Begin(h Headers) error
- func (c *Connection) BytesRead() int64
- func (c *Connection) BytesWritten() int64
- func (c *Connection) Commit(h Headers) error
- func (c *Connection) Connected() bool
- func (c *Connection) Disconnect(h Headers) error
- func (c *Connection) EnableReadDeadline(e bool)
- func (c *Connection) EnableWriteDeadline(e bool)
- func (c *Connection) ExpiredNotification(enf ExpiredNotification)
- func (c *Connection) FramesRead() int64
- func (c *Connection) FramesWritten() int64
- func (c *Connection) GetLogger() *log.Logger
- func (c *Connection) IsReadDeadlineEnabled() bool
- func (c *Connection) IsWriteDeadlineEnabled() bool
- func (c *Connection) Nack(h Headers) error
- func (c *Connection) Protocol() string
- func (c *Connection) ReadDeadline(d time.Duration)
- func (c *Connection) ReceiveTickerCount() int64
- func (c *Connection) ReceiveTickerInterval() int64
- func (c *Connection) Running() time.Duration
- func (c *Connection) Send(h Headers, b string) error
- func (c *Connection) SendBytes(h Headers, b []byte) error
- func (c *Connection) SendTickerCount() int64
- func (c *Connection) SendTickerInterval() int64
- func (c *Connection) Session() string
- func (c *Connection) SetLogger(l *log.Logger)
- func (c *Connection) SetSubChanCap(nc int)
- func (c *Connection) ShortWriteRecovery(ro bool)
- func (c *Connection) SubChanCap() int
- func (c *Connection) Subscribe(h Headers) (<-chan MessageData, error)
- func (c *Connection) Unsubscribe(h Headers) error
- func (c *Connection) WriteDeadline(d time.Duration)
- type Deadliner
- type Error
- type ExpiredNotification
- type Frame
- type HBDataReader
- type Headers
- func (h Headers) Add(k, v string) Headers
- func (h Headers) AddHeaders(o Headers) Headers
- func (h Headers) Bytes() []byte
- func (h Headers) Clone() Headers
- func (h Headers) Compare(other Headers) bool
- func (h Headers) Contains(k string) (string, bool)
- func (h Headers) ContainsKV(k string, v string) bool
- func (h Headers) Delete(k string) Headers
- func (h Headers) Index(k string) int
- func (h Headers) Size(e bool) int64
- func (h Headers) String() string
- func (h Headers) Validate() error
- func (h Headers) ValidateUTF8() (string, error)
- func (h Headers) Value(k string) string
- type Message
- type MessageData
- type Monitor
- type ParmHandler
- type STOMPConnector
- type StatsReader
- type Stomper
Constants ¶
const ( // Client generated commands. CONNECT = "CONNECT" STOMP = "STOMP" DISCONNECT = "DISCONNECT" SEND = "SEND" SUBSCRIBE = "SUBSCRIBE" UNSUBSCRIBE = "UNSUBSCRIBE" ACK = "ACK" NACK = "NACK" BEGIN = "BEGIN" COMMIT = "COMMIT" ABORT = "ABORT" // Server generated commands. CONNECTED = "CONNECTED" MESSAGE = "MESSAGE" RECEIPT = "RECEIPT" ERROR = "ERROR" // Supported STOMP protocol definitions. SPL_10 = "1.0" SPL_11 = "1.1" SPL_12 = "1.2" )
const ( // ERROR Frame returned by broker on connect. ECONERR = Error("broker returned ERROR frame, CONNECT") // ERRORs for Headers. EHDRLEN = Error("unmatched headers, bad length") EHDRUTF8 = Error("header string not UTF8") EHDRNIL = Error("headers can not be nil") EUNKHDR = Error("corrupt frame headers") EHDRMTK = Error("header key can not be empty") EHDRMTV = Error("header value can not be empty") // ERRORs for response to CONNECT. EUNKFRM = Error("unrecognized frame returned, CONNECT") EBADFRM = Error("Malformed frame") EBADSSLP = Error("Got HandShake data, wrong SSL port?") // No body allowed error EBDYDATA = Error("body data not allowed") // Not connected. ECONBAD = Error("no current connection or DISCONNECT previously completed") // Destination required EREQDSTSND = Error("destination required, SEND") EREQDSTSUB = Error("destination required, SUBSCRIBE") EREQDIUNS = Error("destination required, UNSUBSCRIBE") EREQDSTUNS = Error("destination required, UNSUBSCRIBE") // Alternate name // id required EREQIDUNS = Error("id required, UNSUBSCRIBE") // Message ID required. EREQMIDACK = Error("message-id required, ACK") // 1.0, 1.1 EREQIDACK = Error("id required, ACK") // 1.2 // Subscription required. EREQSUBACK = Error("subscription required, ACK") // 1.1 // NACK's. STOMP 1.1 or greater. EREQMIDNAK = Error("message-id required, NACK") // 1.1 EREQSUBNAK = Error("subscription required, NACK") // 1.1 EREQIDNAK = Error("id required, NACK") // 1.2 // Transaction ID required. EREQTIDBEG = Error("transaction-id required, BEGIN") EREQTIDCOM = Error("transaction-id required, COMMIT") EREQTIDABT = Error("transaction-id required, ABORT") // Transaction ID present but empty. ETIDBEGEMT = Error("transaction-id empty, BEGIN") ETIDCOMEMT = Error("transaction-id empty, COMMIT") ETIDABTEMT = Error("transaction-id empty, ABORT") // Host header required, STOMP 1.1+ EREQHOST = Error("host header required for STOMP 1.1+") // Subscription errors. EDUPSID = Error("duplicate subscription-id") EBADSID = Error("invalid subscription-id") // Subscribe errors. ESBADAM = Error("invalid ackmode, SUBSCRIBE") // Unsubscribe error. EUNOSID = Error("id required, UNSUBSCRIBE") EUNODSID = Error("destination or id required, UNSUBSCRIBE") // 1.0 // Unsupported version error. EBADVERCLI = Error("unsupported protocol version, client") EBADVERSVR = Error("unsupported protocol version, server") EBADVERNAK = Error("unsupported protocol version, NACK") // Unsupported Headers type. EBADHDR = Error("unsupported Headers type") // Receipt not allowed on connect ENORECPT = Error("receipt not allowed on CONNECT") // Invalid broker command EINVBCMD = Error("invalid broker command") // Invalid receipt-id string EBADRID = Error("invalid receipt-id") // DISCONNECT timeout EDISCTO = Error("DISCONNECT timeout") )
Error constants.
const ( HK_ACCEPT_VERSION = "accept-version" HK_ACK = "ack" HK_CONTENT_TYPE = "content-type" HK_CONTENT_LENGTH = "content-length" HK_DESTINATION = "destination" HK_HEART_BEAT = "heart-beat" HK_HOST = "host" // HK_VHOST aloas HK_ID = "id" HK_LOGIN = "login" HK_MESSAGE = "message" HK_MESSAGE_ID = "message-id" HK_SUPPRESS_CL = "suppress-content-length" // Not in any spec, but used HK_SUPPRESS_CT = "suppress-content-type" // Not in any spec, but used HK_PASSCODE = "passcode" HK_RECEIPT = "receipt" HK_RECEIPT_ID = "receipt-id" HK_SESSION = "session" HK_SERVER = "server" HK_SUBSCRIPTION = "subscription" HK_TRANSACTION = "transaction" HK_VERSION = "version" HK_VHOST = "host" // HK_HOST alias )
Common Header keys
const ( AckModeAuto = "auto" AckModeClient = "client" AckModeClientIndividual = "client-individual" )
ACK Modes
const ( StompPlusDrainAfter = "sng_drafter" // SUBSCRIBE Header StompPlusDrainNow = "sng_drnow" // UNSUBSCRIBE Header )
Extensions to STOMP protocol.
const (
DFLT_CONTENT_TYPE = "text/plain; charset=UTF-8"
)
Default content-type.
const (
NetProtoTCP = "tcp" // Protocol Name
)
Variables ¶
var ( LFB = []byte("\n") ZRB = []byte{0} )
var HandShake = []byte{0x15, 0x03, 0x03, 0x00}
var NULLBUFF = make([]uint8, 0)
A zero length buffer for convenience.
var NoDiscReceipt = Headers{"noreceipt", "true"}
A no disconnect receipt Headers value for convenience.
Functions ¶
func Protocols ¶
func Protocols() []string
Protocols returns a slice of client supported protocol levels.
Types ¶
type Connection ¶
type Connection struct { ConnectResponse *Message // Broker response (CONNECTED/ERROR) if physical connection successful. DisconnectReceipt MessageData // If receipt requested on DISCONNECT. MessageData <-chan MessageData // Inbound data for the client. Hbrf bool // Indicates a heart beat read/receive failure, which is possibly transient. Valid for 1.1+ only. Hbsf bool // Indicates a heart beat send failure, which is possibly transient. Valid for 1.1+ only. // contains filtered or unexported fields }
Connection is a representation of a STOMP connection.
func Connect ¶
func Connect(n net.Conn, h Headers) (*Connection, error)
Primary STOMP Connect.
For STOMP 1.1+ the Headers parameter MUST contain the headers required by the specification. Those headers are not magically inferred.
Example:
// Obtain a network connection n, e := net.Dial(NetProtoTCP, "localhost:61613") if e != nil { // Do something sane ... } h := stompngo.Headers{} // A STOMP 1.0 connection request c, e := stompngo.Connect(n, h) if e != nil { // Do something sane ... } // Use c
Example:
// Obtain a network connection n, e := net.Dial(NetProtoTCP, "localhost:61613") if e != nil { // Do something sane ... } h := stompngo.Headers{HK_ACCEPT_VERSION, "1.1", HK_HOST, "localhost"} // A STOMP 1.1 connection c, e := stompngo.Connect(n, h) if e != nil { // Do something sane ... } // Use c
func (*Connection) Abort ¶
func (c *Connection) Abort(h Headers) error
Abort a STOMP transaction.
Headers MUST contain a "transaction" header key with a value that is not an empty string.
Example:
h := stompngo.Headers{stompngo.HK_TRANSACTION, "transaction-id1"} e := c.Abort(h) if e != nil { // Do something sane ... }
func (*Connection) Ack ¶
func (c *Connection) Ack(h Headers) error
Ack a STOMP MESSAGE.
For Stomp 1.0 Headers MUST contain a "message-id" header key.
For Stomp 1.1 Headers must contain a "message-id" key and a "subscription" header key.
For Stomp 1.2 Headers must contain a unique "id" header key.
See the specifications at http://stomp.github.com/ for details.
Example:
h := stompngo.Headers{stompngo.HK_MESSAGE_ID, "message-id1", "subscription", "d2cbe608b70a54c8e69d951b246999fbc20df694"} e := c.Ack(h) if e != nil { // Do something sane ... }
func (*Connection) Begin ¶
func (c *Connection) Begin(h Headers) error
Begin a STOMP transaction.
Headers MUST contain a "transaction" header key with a value that is not an empty string.
Example:
h := stompngo.Headers{stompngo.HK_TRANSACTION, "transaction-id1"} e := c.Begin(h) if e != nil { // Do something sane ... }
func (*Connection) BytesRead ¶
func (c *Connection) BytesRead() int64
BytesRead returns a count of the number of bytes read on the connection.
func (*Connection) BytesWritten ¶
func (c *Connection) BytesWritten() int64
BytesWritten returns a count of the number of bytes written on the connection.
func (*Connection) Commit ¶
func (c *Connection) Commit(h Headers) error
Commit a STOMP transaction.
Headers MUST contain a "transaction" header key with a value that is not an empty string.
Example:
h := stompngo.Headers{stompngo.HK_TRANSACTION, "transaction-id1"} e := c.Begin(h) if e != nil { // Do something sane ... }
func (*Connection) Connected ¶
func (c *Connection) Connected() bool
Connected returns the current connection status.
func (*Connection) Disconnect ¶
func (c *Connection) Disconnect(h Headers) error
Disconnect from a STOMP broker.
Shut down heart beats if necessary. Set connection status to false to disable further actions with this connection.
Obtain a receipt unless the client specifically indicates a receipt request should be excluded. If the client actually asks for a receipt, use the supplied receipt id. Otherwise generate a unique receipt id and add that to the DISCONNECT headers.
Example:
h := stompngo.Headers{HK_RECEIPT, "receipt-id1"} // Ask for a receipt e := c.Disconnect(h) if e != nil { // Do something sane ... } fmt.Printf("%q\n", c.DisconnectReceipt) // Or: h := stompngo.Headers{"noreceipt", "true"} // Ask for a receipt e := c.Disconnect(h) if e != nil { // Do something sane ... } fmt.Printf("%q\n", c.DisconnectReceipt)
func (*Connection) EnableReadDeadline ¶
func (c *Connection) EnableReadDeadline(e bool)
EnableReadDeadline enables/disables the use of read deadlines.
func (*Connection) EnableWriteDeadline ¶
func (c *Connection) EnableWriteDeadline(e bool)
EnableWriteDeadline enables/disables the use of write deadlines.
func (*Connection) ExpiredNotification ¶
func (c *Connection) ExpiredNotification(enf ExpiredNotification)
ExpiredNotification sets the expired notification callback function.
func (*Connection) FramesRead ¶
func (c *Connection) FramesRead() int64
FramesRead returns a count of the number of frames read on the connection.
func (*Connection) FramesWritten ¶
func (c *Connection) FramesWritten() int64
FramesWritten returns a count of the number of frames written on the connection.
func (*Connection) GetLogger ¶
func (c *Connection) GetLogger() *log.Logger
GetLogger - returns the current connection logger.
func (*Connection) IsReadDeadlineEnabled ¶
func (c *Connection) IsReadDeadlineEnabled() bool
IsReadDeadlineEnabled returns the current value of write deadline enablement.
func (*Connection) IsWriteDeadlineEnabled ¶
func (c *Connection) IsWriteDeadlineEnabled() bool
IsWriteDeadlineEnabled returns the current value of write deadline enablement.
func (*Connection) Nack ¶
func (c *Connection) Nack(h Headers) error
Nack a STOMP 1.1+ message.
For Stomp 1.1 Headers must contain a "message-id" key and a "subscription" header key.
For Stomp 1.2 Headers must contain a unique "id" header key.
See the specifications at http://stomp.github.com/ for details.
Disallowed for an established STOMP 1.0 connection, and EBADVERNAK is returned.
Example:
h := stompngo.Headers{stompngo.HK_MESSAGE_ID, "message-id1", stompngo.HK_SUBSCRIPTION, "d2cbe608b70a54c8e69d951b246999fbc20df694"} e := c.Nack(h) if e != nil { // Do something sane ... }
func (*Connection) Protocol ¶
func (c *Connection) Protocol() string
Protocol returns the current connection protocol level.
func (*Connection) ReadDeadline ¶
func (c *Connection) ReadDeadline(d time.Duration)
ReadDeadline sets the write deadline duration.
func (*Connection) ReceiveTickerCount ¶
func (c *Connection) ReceiveTickerCount() int64
ReceiveTickerCount returns any heartbeat receive ticker count. A return value of zero usually indicates no read heartbeats are enabled.
func (*Connection) ReceiveTickerInterval ¶
func (c *Connection) ReceiveTickerInterval() int64
ReceiveTickerInterval returns any heartbeat receive ticker interval in ms. A return value of zero means no heartbeats are being received.
func (*Connection) Running ¶
func (c *Connection) Running() time.Duration
Running returns a time duration since connection start.
func (*Connection) Send ¶
func (c *Connection) Send(h Headers, b string) error
Send a STOMP MESSAGE.
Headers MUST contain a "destination" header key.
The message body (payload) is a string, which may be empty.
Example:
h := stompngo.Headers{stompngo.HK_DESTINATION, "/queue/mymessages"} m := "My message" e := c.Send(h, m) if e != nil { // Do something sane ... }
func (*Connection) SendBytes ¶
func (c *Connection) SendBytes(h Headers, b []byte) error
Send a STOMP MESSAGE.
Headers MUST contain a "destination" header key.
The message body (payload) is a slice of bytes, which may be empty.
Example:
h := stompngo.Headers{stompngo.HK_DESTINATION, "/queue/mymessages"} m := []byte("My message") e := c.Send(h, m) if e != nil { // Do something sane ... }
func (*Connection) SendTickerCount ¶
func (c *Connection) SendTickerCount() int64
SendTickerCount returns any heartbeat send ticker count. A return value of zero usually indicates no send heartbeats are enabled.
func (*Connection) SendTickerInterval ¶
func (c *Connection) SendTickerInterval() int64
SendTickerInterval returns any heartbeat send ticker interval in ms. A return value of zero means no heartbeats are being sent.
func (*Connection) Session ¶
func (c *Connection) Session() string
Session returns the broker assigned session id.
func (*Connection) SetLogger ¶
func (c *Connection) SetLogger(l *log.Logger)
SetLogger enables a client defined logger for this connection.
Set to "nil" to disable logging.
Example:
// Start logging l := log.New(os.Stdout, "", log.Ldate|log.Lmicroseconds) c.SetLogger(l)
func (*Connection) SetSubChanCap ¶
func (c *Connection) SetSubChanCap(nc int)
SetSubChanCap sets a new subscribe channel capacity, to be used during future SUBSCRIBE operations.
func (*Connection) ShortWriteRecovery ¶
func (c *Connection) ShortWriteRecovery(ro bool)
ShortWriteRecovery enables / disables short write recovery. enablement.
func (*Connection) SubChanCap ¶
func (c *Connection) SubChanCap() int
SubChanCap returns the current subscribe channel capacity.
func (*Connection) Subscribe ¶
func (c *Connection) Subscribe(h Headers) (<-chan MessageData, error)
Subscribe to a STOMP subscription.
Headers MUST contain a "destination" header key.
All clients are recommended to supply a unique HK_ID header on Subscribe.
For STOMP 1.0 clients: if an "id" header is supplied, attempt to use it. If the "id" header is not unique in the session, return an error. If no "id" header is supplied, attempt to generate a unique subscription id based on the destination name. If a unique subscription id cannot be generated, return an error.
For STOMP 1.1+ clients: If any client does not supply an HK_ID header, attempt to generate a unique "id". In all cases, do not allow duplicate subscription "id"s in this session.
In summary, multiple subscriptions to the same destination are not allowed unless a unique "id" is supplied.
For details about the returned MessageData channel, see: https://github.com/gmallard/stompngo/wiki/subscribe-and-messagedata
Example:
// Possible additional Header keys: "ack", "id". h := stompngo.Headers{stompngo.HK_DESTINATION, "/queue/myqueue"} s, e := c.Subscribe(h) if e != nil { // Do something sane ... }
func (*Connection) Unsubscribe ¶
func (c *Connection) Unsubscribe(h Headers) error
Unsubscribe from a STOMP subscription.
Headers MUST contain a "destination" header key, and for Stomp 1.1+, a "id" header key per the specifications. The subscription MUST currently exist for this session.
Example:
// Possible additional Header keys: "id". h := stompngo.Headers{stompngo.HK_DESTINATION, "/queue/myqueue"} e := c.Unsubscribe(h) if e != nil { // Do something sane ... }
func (*Connection) WriteDeadline ¶
func (c *Connection) WriteDeadline(d time.Duration)
WriteDeadline sets the write deadline duration.
type Deadliner ¶
type Deadliner interface { WriteDeadline(d time.Duration) EnableWriteDeadline(e bool) ExpiredNotification(enf ExpiredNotification) IsWriteDeadlineEnabled() bool ReadDeadline(d time.Duration) EnableReadDeadline(e bool) IsReadDeadlineEnabled() bool ShortWriteRecovery(ro bool) }
Deadliner is an interface that models the optional network deadline functionality implemented by the stompngo package.
type ExpiredNotification ¶
ExpiredNotification is a callback function, provided by the client and called when a deadline expires. The err parameter will contain the actual expired error. The rw parameter will be true if the notification is for a write, and false otherwise.
type Frame ¶
type Frame Message
Frame is an alternate name for a Message.
type HBDataReader ¶
type HBDataReader interface { SendTickerInterval() int64 ReceiveTickerInterval() int64 SendTickerCount() int64 ReceiveTickerCount() int64 }
HBDataReader is an interface that models a reader for the heart beat data maintained by the stompngo package.
type Headers ¶
type Headers []string
Headers definition, a slice of string.
STOMP headers are key and value pairs. See the specification for more information about STOMP frame headers.
Key values are found at even numbered indices. Values are found at odd numbered indices. Headers are validated for an even number of slice elements.
func (Headers) AddHeaders ¶
AddHeaders appends one set of Headers to another.
func (Headers) ContainsKV ¶
ContainsKV returns true if a set of Headers contains a key and value pair.
func (Headers) Index ¶
Index returns the index of a keader key in Headers. Return -1 if the key is not present.
func (Headers) ValidateUTF8 ¶
ValidateUTF8 validates that header strings are UTF8.
type Message ¶
Message is a STOMP Message, consisting of: a STOMP command; a set of STOMP Headers; and a message body(payload), which is possibly empty.
func (*Message) BodyString ¶
BodyString returns a Message body as a string.
type MessageData ¶
MessageData passed to the client, containing: the Message; and an Error value which is possibly nil.
Note that this has no relevance on whether a MessageData.Message.Command value contains an "ERROR" generated by the broker.
type Monitor ¶
type Monitor interface { Connected() bool Session() string Protocol() string Running() time.Duration SubChanCap() int }
Monitor is an interface that models monitoring a stompngo connection.
type ParmHandler ¶
type ParmHandler interface { SetLogger(l *log.Logger) GetLogger() *log.Logger SetSubChanCap(nc int) }
ParmHandler is an interface that models stompngo client parameter specification.
type STOMPConnector ¶
type STOMPConnector interface { Stomper StatsReader HBDataReader Deadliner Monitor ParmHandler }
STOMPConnector is an interface that encapsulates the Connection struct.
func ConnectOverWS ¶
func ConnectOverWS(n *websocket.Conn, h Headers) (STOMPConnector, error)
func NewConnector ¶
func NewConnector(n net.Conn, h Headers) (STOMPConnector, error)
Wrapper for primary STOMP Connect function that returns an interface.
func NewConnectorOverWS ¶
func NewConnectorOverWS(n *websocket.Conn, h Headers) (STOMPConnector, error)
type StatsReader ¶
type StatsReader interface { FramesRead() int64 BytesRead() int64 FramesWritten() int64 BytesWritten() int64 }
StatsReader is an interface that modela a reader for the statistics maintained by the stompngo package.
type Stomper ¶
type Stomper interface { Abort(h Headers) error Ack(headers Headers) error Begin(h Headers) error Commit(h Headers) error Disconnect(headers Headers) error Nack(headers Headers) error Send(Headers, string) error Subscribe(headers Headers) (<-chan MessageData, error) Unsubscribe(headers Headers) error // SendBytes(h Headers, b []byte) error }
Stomper is an interface that models STOMP specification commands.
Source Files ¶
- abort.go
- ack.go
- begin.go
- commit.go
- connect.go
- connect_helpers.go
- connection.go
- data.go
- deadline_data.go
- disconnect.go
- doc.go
- error_methods.go
- frame_methods.go
- header_methods.go
- heartbeats.go
- message_methods.go
- nack.go
- reader.go
- send.go
- sendbytes.go
- subscribe.go
- transmit.go
- unsubscribe.go
- utils.go
- utils_exp.go
- version.go
- writer.go
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Helper package for stompngo users.
|
Helper package for stompngo users. |