v0.0.0-...-cf35b07 Latest Latest

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

Go to latest
Published: Apr 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 0




This section is empty.


View Source
var TlsSchemes = []string{"tcps", "ssl", "tls", "redis"}


func GenerateTLSForClientClientOptions

func GenerateTLSForClientClientOptions(
	brokerURL string,
	tlsConfigurationOptions TlsConfigurationOptions,
	certCreator X509KeyPairCreator,
	certLoader X509KeyLoader) (*tls.Config, error)

generateTLSForClientClientOptions creates a tls.Config which can be used when configuring the underlying MQTT client. If TLS is not needed then nil will be returned which can be used to signal no TLS is needed to the MQTT client.

func Load

func Load(config map[string]string, des interface{}) error

load by reflect to check map key and then fetch the value. This function ignores properties that have not been provided from the source. Therefore it is recommended to provide a destination struct with reasonable defaults.

NOTE: This logic was borrowed from device-mqtt-go and some additional logic was added to accommodate more types.


type BrokerURLErr

type BrokerURLErr struct {
	// contains filtered or unexported fields

BrokerURLErr represents an error associated parsing a broker's URL.

func NewBrokerURLErr

func NewBrokerURLErr(description string) BrokerURLErr

NewBrokerURLErr constructs a new BrokerURLErr

func (BrokerURLErr) Error

func (bue BrokerURLErr) Error() string

type CertificateErr

type CertificateErr struct {
	// contains filtered or unexported fields

CertificateErr represents an error associated with interacting with a Certificate.

func NewCertificateErr

func NewCertificateErr(message string) CertificateErr

NewCertificateErr constructs a new CertificateErr

func (CertificateErr) Error

func (ce CertificateErr) Error() string

type InvalidTopicErr

type InvalidTopicErr struct {
	// contains filtered or unexported fields

func NewInvalidTopicErr

func NewInvalidTopicErr(topic string, description string) InvalidTopicErr

func (InvalidTopicErr) Error

func (ite InvalidTopicErr) Error() string

type MissingConfigurationErr

type MissingConfigurationErr struct {
	// contains filtered or unexported fields

func NewMissingConfigurationErr

func NewMissingConfigurationErr(missingConfiguration string, message string) MissingConfigurationErr

func (MissingConfigurationErr) Error

func (mce MissingConfigurationErr) Error() string

type PublishHostURLErr

type PublishHostURLErr struct {
	// contains filtered or unexported fields

func NewPublishHostURLErr

func NewPublishHostURLErr(message string) PublishHostURLErr

func (PublishHostURLErr) Error

func (p PublishHostURLErr) Error() string

type SubscribeHostURLErr

type SubscribeHostURLErr struct {
	// contains filtered or unexported fields

func NewSubscribeHostURLErr

func NewSubscribeHostURLErr(message string) SubscribeHostURLErr

func (SubscribeHostURLErr) Error

func (p SubscribeHostURLErr) Error() string

type TlsConfigurationOptions

type TlsConfigurationOptions struct {
	SkipCertVerify bool
	CertFile       string
	KeyFile        string
	KeyPEMBlock    string
	CertPEMBlock   string

func CreateDefaultTlsConfigurationOptions

func CreateDefaultTlsConfigurationOptions() TlsConfigurationOptions

type X509KeyLoader

type X509KeyLoader func(certFile string, keyFile string) (tls.Certificate, error)

X509KeyLoader defines a function signature for loading a tls.Certificate from cert and key files.

type X509KeyPairCreator

type X509KeyPairCreator func(certPEMBlock []byte, keyPEMBlock []byte) (tls.Certificate, error)

X509KeyPairCreator defines the function signature for creating a tls.Certificate based on PEM encoding.


Path Synopsis
streams package contains a RedisClient which leverages go-redis to interact with a Redis server.
streams package contains a RedisClient which leverages go-redis to interact with a Redis server.

Jump to

Keyboard shortcuts

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