awsiotprotocol

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package awsiotprotocol is internal implementation of awsiotdev package. It implements MQTT connection type loader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	KeyPath  string
	CertPath string
	CaPath   string
	ClientID string
	URL      string
}

Config stores internal MQTT connection configuration.

type MockProtocol

type MockProtocol struct {
}

MockProtocol implements Protocol interface without actual connection. This is for testing.

func (MockProtocol) Name

func (s MockProtocol) Name() string

Name returns the protocol name.

func (MockProtocol) NewClientOptions

func (s MockProtocol) NewClientOptions(opt *Config) (*mqtt.ClientOptions, error)

NewClientOptions returns MQTT connection options.

type Mqtts

type Mqtts struct {
}

Mqtts implements Protocol interface for MQTT over TLS using x.509 certifications.

func (Mqtts) Name

func (s Mqtts) Name() string

Name returns the protocol name.

func (Mqtts) NewClientOptions

func (s Mqtts) NewClientOptions(opt *Config) (*mqtt.ClientOptions, error)

NewClientOptions returns MQTT connection options.

type Protocol

type Protocol interface {
	Name() string
	NewClientOptions(opt *Config) (*mqtt.ClientOptions, error)
}

Protocol is the interface to describe MQTT connection type.

func ByURL

func ByURL(u string) (Protocol, error)

ByURL selects MQTT connection type by URL string.

type Wss

type Wss struct {
}

Wss implements Protocol interface for MQTT over Websocket.

func (Wss) Name

func (s Wss) Name() string

Name returns the protocol name.

func (Wss) NewClientOptions

func (s Wss) NewClientOptions(opt *Config) (*mqtt.ClientOptions, error)

NewClientOptions returns MQTT connection options.

Jump to

Keyboard shortcuts

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