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 NewGCPCloudIoTCoreAuthentication ¶
func NewGCPCloudIoTCoreAuthentication(config GCPCloudIoTCoreConfig) (Authentication, error)
NewGCPCloudIoTCoreAuthentication create a GCPCloudIoTCoreAuthentication.
func NewGenericAuthentication ¶
func NewGenericAuthentication(config GenericConfig) (Authentication, error)
NewGenericAuthentication creates a GenericAuthentication.
type GCPCloudIoTCoreAuthentication ¶
type GCPCloudIoTCoreAuthentication struct {
// contains filtered or unexported fields
}
GCPCloudIoTCoreAuthentication implements the Google Cloud IoT Core authentication.
func (*GCPCloudIoTCoreAuthentication) Init ¶
func (a *GCPCloudIoTCoreAuthentication) Init(opts *mqtt.ClientOptions) error
Init applies the initial configuration.
func (*GCPCloudIoTCoreAuthentication) ReconnectAfter ¶
func (a *GCPCloudIoTCoreAuthentication) 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 (*GCPCloudIoTCoreAuthentication) Update ¶
func (a *GCPCloudIoTCoreAuthentication) Update(opts *mqtt.ClientOptions) error
Update updates the authentication options.
type GCPCloudIoTCoreConfig ¶
type GCPCloudIoTCoreConfig struct { Server string DeviceID string `mapstructure:"device_id"` ProjectID string `mapstructure:"project_id"` CloudRegion string `mapstructure:"cloud_region"` RegistryID string `mapstructure:"registry_id"` JWTExpiration time.Duration `mapstructure:"jwt_expiration"` JWTKeyFile string `mapstructure:"jwt_key_file"` }
GCPCloudIoTCoreConfig devices the Cloud IoT Core configuration.
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.