Documentation ¶
Index ¶
- func WritePubMessage(ctx context.Context, m binding.Message, pubMessage *paho.Publish, ...) error
- type Message
- func (m *Message) Finish(error) error
- func (m *Message) GetAttribute(k spec.Kind) (spec.Attribute, interface{})
- func (m *Message) GetExtension(name string) interface{}
- func (m *Message) ReadBinary(ctx context.Context, encoder binding.BinaryWriter) (err error)
- func (m *Message) ReadEncoding() binding.Encoding
- func (m *Message) ReadStructured(ctx context.Context, encoder binding.StructuredWriter) error
- type Option
- type Protocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WritePubMessage ¶
func WritePubMessage(ctx context.Context, m binding.Message, pubMessage *paho.Publish, transformers ...binding.Transformer) error
WritePubMessage fills the provided pubMessage with the message m. Using context you can tweak the encoding processing (more details on binding.Write documentation).
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message represents a MQTT message. This message *can* be read several times safely
func NewMessage ¶
func (*Message) GetAttribute ¶
func (*Message) GetExtension ¶
func (*Message) ReadBinary ¶
func (*Message) ReadEncoding ¶
func (*Message) ReadStructured ¶
type Option ¶
Option is the function signature required to be considered an mqtt_paho.Option.
func WithConnect ¶
WithConnect sets the paho.Connect configuration for the client. This option is not required.
func WithPublish ¶
WithPublish sets the paho.Publish configuration for the client. This option is required if you want to send messages.
func WithSubscribe ¶
WithSubscribe sets the paho.Subscribe configuration for the client. This option is required if you want to receive messages.