Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageEnvelope ¶
type MessageEnvelope struct {
// Payload is byte representation of the data being transferred.
Payload []byte `json:"payload"`
// ReceivedTopic is the topic that the message was received on.
ReceivedTopic string `json:"receivedTopic"`
// ContentType is the marshaled type of payload, i.e. application/json, application/xml, application/cbor, etc
ContentType string `json:"contentType"`
// CorrelationID is an object id to identify the envelope.
CorrelationID string `json:"correlationID"`
}
MessageEnvelope is the data structure for messages. It wraps the generic message payload with attributes.
func NewMessageEnvelope ¶ added in v1.0.5
func NewMessageEnvelope(payload []byte, ctx context.Context) MessageEnvelope
NewMessageEnvelope creates a new MessageEnvelope for the specified payload with attributes from the specified context
type Mqtt5Config ¶
type Mqtt5Config struct {
// hostname_rfc1123 refers to https://github.com/go-playground/validator/blob/94a637ab9fbbb0bc0fe8a278f0352d0b14e2c365/regexes.go#L52C22-L52C22
Host string `validate:"required,ip|hostname_rfc1123"`
Port int `validate:"required"`
Protocol string `validate:"required"`
AuthMode string
SecretName string
ClientID string // Client ID to use when connecting to server
QoS int // QOS to use when publishing
KeepAlive uint16 // seconds between keepalive packets
CleanStart bool
Topics map[string]string
}
Click to show internal directories.
Click to hide internal directories.