mqtt

package
v1.4.3-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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) Client

func (b *Broker) Client(cid string) (*Client, error)

func (*Broker) ClientWithOptions

func (b *Broker) ClientWithOptions(opt *mqtt.ClientOptions) (*Client, error)

func (*Broker) Close

func (b *Broker) Close(c *Client)

func (*Broker) CloseByCid added in v1.1.0

func (b *Broker) CloseByCid(cid string)

func (*Broker) Init

func (b *Broker) Init() error

func (*Broker) LivenessCheck added in v1.1.0

func (b *Broker) LivenessCheck() map[string]string

func (*Broker) Name added in v1.1.0

func (b *Broker) Name() string

func (*Broker) SetDefault

func (b *Broker) SetDefault()

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Cid

func (c *Client) Cid() string

func (*Client) Publish

func (c *Client) Publish(payload interface{}) error

func (*Client) Subscribe

func (c *Client) Subscribe(handler mqtt.MessageHandler) error

func (*Client) Unsubscribe added in v1.0.0

func (c *Client) Unsubscribe() error

func (*Client) WithConnTimeout added in v1.1.0

func (c *Client) WithConnTimeout(timeout time.Duration) *Client

func (*Client) WithQoS

func (c *Client) WithQoS(qos QOS) *Client

func (*Client) WithRetain

func (c *Client) WithRetain(retain bool) *Client

func (*Client) WithSubTimeout added in v1.1.0

func (c *Client) WithSubTimeout(timeout time.Duration) *Client

func (*Client) WithTopic

func (c *Client) WithTopic(topic string) *Client

type QOS

type QOS int8
const (
	QOS_UNKNOWN        QOS = iota - 1
	QOS__ONCE              // 0
	QOS__AT_LEAST_ONCE     // 1
	QOS__ONLY_ONCE         // 2
)

func ParseQOSFromLabel

func ParseQOSFromLabel(s string) (QOS, error)

func ParseQOSFromString

func ParseQOSFromString(s string) (QOS, error)

func (QOS) ConstValues

func (v QOS) ConstValues() []enum.IntStringerEnum

func (QOS) Int

func (v QOS) Int() int

func (QOS) Label

func (v QOS) Label() string

func (QOS) MarshalText

func (v QOS) MarshalText() ([]byte, error)

func (*QOS) Scan

func (v *QOS) Scan(src interface{}) error

func (QOS) String

func (v QOS) String() string

func (QOS) TypeName

func (v QOS) TypeName() string

func (*QOS) UnmarshalText

func (v *QOS) UnmarshalText(data []byte) error

func (QOS) Value

func (v QOS) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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