Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication interface {
// Init applies the initial configuration.
Init(*mqtt.ClientOptions) error
// Update updates the authentication options.
Update(*mqtt.ClientOptions) error
// ReconnectAfter returns a time.Duration after which the MQTT client must re-connect.
// Note: return 0 to disable the periodical re-connect feature.
ReconnectAfter() time.Duration
}
Authentication defines the authentication interface.
func NewGenericAuthentication ¶
func NewGenericAuthentication(config GenericConfig) (Authentication, error)
NewGenericAuthentication creates a GenericAuthentication.
type GenericAuthentication ¶
type GenericAuthentication struct {
// contains filtered or unexported fields
}
GenericAuthentication implements a generic MQTT authentication.
func (*GenericAuthentication) Init ¶
func (a *GenericAuthentication) Init(opts *mqtt.ClientOptions) error
Init applies the initial configuration.
func (*GenericAuthentication) ReconnectAfter ¶
func (a *GenericAuthentication) ReconnectAfter() time.Duration
ReconnectAfter returns a time.Duration after which the MQTT client must re-connect. Note: return 0 to disable the periodical re-connect feature.
func (*GenericAuthentication) Update ¶
func (a *GenericAuthentication) Update(opts *mqtt.ClientOptions) error
Update updates the authentication options.
type GenericConfig ¶
type GenericConfig struct {
Server string
Username string
Password string
CACert string `mapstructure:"ca_cert"`
TLSCert string `mapstructure:"tls_cert"`
TLSKey string `mapstructure:"tls_key"`
QOS uint8 `mapstructure:"qos"`
CleanSession bool `mapstructure:"clean_session"`
ClientID string `mapstructure:"client_id"`
MaxReconnectInterval time.Duration `mapstructure:"max_reconnect_interval"`
}
GenericConfig defines the generic configuration.
Click to show internal directories.
Click to hide internal directories.