Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) DiagnosticArchive(_ context.Context, archive types.ArchiveWriter) error
- func (c *Client) Disable(until time.Time)
- func (c *Client) DisabledUntil() time.Time
- func (c *Client) Disconnect(timeout time.Duration)
- func (c *Client) IsConnectionOpen() bool
- func (c *Client) LastReport() time.Time
- func (c *Client) Publish(topic string, payload interface{}, retry bool) error
- func (c *Client) Run(ctx context.Context)
- type LogWrapper
- type Options
- type ReloadState
- func (rs *ReloadState) AddPendingMessage(ctx context.Context, m types.Message, shouldWait bool) bool
- func (rs *ReloadState) Client() paho.Client
- func (rs *ReloadState) Close()
- func (rs *ReloadState) ConnectionLostChannel() <-chan error
- func (rs *ReloadState) OnConnectionLost(_ paho.Client, err error)
- func (rs *ReloadState) PendingMessage(ctx context.Context) (m types.Message, open bool)
- func (rs *ReloadState) PendingMessagesCount() int
- func (rs *ReloadState) SetClient(cli paho.Client)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPayloadTooLarge = errors.New("payload is too large")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DiagnosticArchive ¶
DiagnosticArchive add to a zipfile useful diagnostic information.
func (*Client) Disable ¶
Disable will disable the MQTT connection until given time. To re-enable use ClearDisable().
func (*Client) DisabledUntil ¶
func (*Client) Disconnect ¶
func (*Client) IsConnectionOpen ¶
func (*Client) LastReport ¶
LastReport returns the date of last acknowledgment received.
type LogWrapper ¶
type LogWrapper struct {
// contains filtered or unexported fields
}
func GetOrCreateWrapper ¶
func GetOrCreateWrapper() *LogWrapper
func (*LogWrapper) LastPingAt ¶
func (w *LogWrapper) LastPingAt() time.Time
type Options ¶
type Options struct { // OptionsFunc returns the options to use when connecting to MQTT. OptionsFunc func(ctx context.Context) (*paho.ClientOptions, error) // Keep a state between reloads. ReloadState types.MQTTReloadState // Function called when too many errors happened. TooManyErrorsHandler func(ctx context.Context) // A unique identifier for this client. ID string PahoLastPingCheckAt func() time.Time }
type ReloadState ¶
type ReloadState struct {
// contains filtered or unexported fields
}
ReloadState implements the types.PahoWrapper interface.
func NewReloadState ¶
func NewReloadState() *ReloadState
func (*ReloadState) AddPendingMessage ¶
func (*ReloadState) Client ¶
func (rs *ReloadState) Client() paho.Client
func (*ReloadState) Close ¶
func (rs *ReloadState) Close()
func (*ReloadState) ConnectionLostChannel ¶
func (rs *ReloadState) ConnectionLostChannel() <-chan error
func (*ReloadState) OnConnectionLost ¶
func (rs *ReloadState) OnConnectionLost(_ paho.Client, err error)
func (*ReloadState) PendingMessage ¶
func (*ReloadState) PendingMessagesCount ¶
func (rs *ReloadState) PendingMessagesCount() int
func (*ReloadState) SetClient ¶
func (rs *ReloadState) SetClient(cli paho.Client)
Click to show internal directories.
Click to hide internal directories.