Documentation ¶
Index ¶
- Variables
- func GenerateTLSForClientClientOptions(brokerURL string, tlsConfigurationOptions TlsConfigurationOptions, ...) (*tls.Config, error)
- func Load(config map[string]string, des interface{}) error
- type BrokerURLErr
- type CertificateErr
- type InvalidTopicErr
- type MissingConfigurationErr
- type PublishHostURLErr
- type SubscribeHostURLErr
- type TlsConfigurationOptions
- type X509KeyLoader
- type X509KeyPairCreator
Constants ¶
This section is empty.
Variables ¶
var TlsSchemes = []string{"tcps", "ssl", "tls", "redis"}
Functions ¶
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 ¶
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. https://github.com/edgexfoundry/device-mqtt-go/blob/a0d50c6e03a7f7dcb28f133885c803ffad3ec502/internal/driver/config.go#L74-L101
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.