Documentation ¶
Index ¶
- Variables
- type Broker
- func (b *Broker) Client(cid string) (*Client, error)
- func (b *Broker) ClientWithOptions(opt *mqtt.ClientOptions) (*Client, error)
- func (b *Broker) Close(c *Client)
- func (b *Broker) CloseByCid(cid string)
- func (b *Broker) Init() error
- func (b *Broker) LivenessCheck() map[string]string
- func (b *Broker) Name() string
- func (b *Broker) SetDefault()
- type Client
- func (c *Client) Cid() string
- func (c *Client) Publish(payload interface{}) error
- func (c *Client) Subscribe(handler mqtt.MessageHandler) error
- func (c *Client) Unsubscribe() error
- func (c *Client) WithConnTimeout(timeout time.Duration) *Client
- func (c *Client) WithQoS(qos QOS) *Client
- func (c *Client) WithRetain(retain bool) *Client
- func (c *Client) WithSubTimeout(timeout time.Duration) *Client
- func (c *Client) WithTopic(topic string) *Client
- type QOS
- func (v QOS) ConstValues() []enum.IntStringerEnum
- func (v QOS) Int() int
- func (v QOS) Label() string
- func (v QOS) MarshalText() ([]byte, error)
- func (v *QOS) Scan(src interface{}) error
- func (v QOS) String() string
- func (v QOS) TypeName() string
- func (v *QOS) UnmarshalText(data []byte) error
- func (v QOS) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidQOS = errors.New("invalid QOS type")
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { Server types.Endpoint Retry retry.Retry Timeout types.Duration Keepalive types.Duration RetainPublish bool QoS QOS Cert *conftls.X509KeyPair // contains filtered or unexported fields }
func (*Broker) ClientWithOptions ¶
func (b *Broker) ClientWithOptions(opt *mqtt.ClientOptions) (*Client, error)
func (*Broker) CloseByCid ¶ added in v1.1.0
func (*Broker) LivenessCheck ¶ added in v1.1.0
func (*Broker) SetDefault ¶
func (b *Broker) SetDefault()
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Unsubscribe ¶ added in v1.0.0
func (*Client) WithConnTimeout ¶ added in v1.1.0
func (*Client) WithRetain ¶
func (*Client) WithSubTimeout ¶ added in v1.1.0
type QOS ¶
type QOS int8
func ParseQOSFromLabel ¶
func ParseQOSFromString ¶
func (QOS) ConstValues ¶
func (v QOS) ConstValues() []enum.IntStringerEnum
func (QOS) MarshalText ¶
func (*QOS) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.