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 ¶ added in v0.1.19
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 ¶ added in v0.1.19
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 ¶ added in v0.1.19
type InvalidTopicErr struct {
// contains filtered or unexported fields
}
func NewInvalidTopicErr ¶ added in v0.1.19
func NewInvalidTopicErr(topic string, description string) InvalidTopicErr
func (InvalidTopicErr) Error ¶ added in v0.1.19
func (ite InvalidTopicErr) Error() string
type MissingConfigurationErr ¶ added in v0.1.19
type MissingConfigurationErr struct {
// contains filtered or unexported fields
}
func NewMissingConfigurationErr ¶ added in v0.1.19
func NewMissingConfigurationErr(missingConfiguration string, message string) MissingConfigurationErr
func (MissingConfigurationErr) Error ¶ added in v0.1.19
func (mce MissingConfigurationErr) Error() string
type PublishHostURLErr ¶ added in v0.1.19
type PublishHostURLErr struct {
// contains filtered or unexported fields
}
func NewPublishHostURLErr ¶ added in v0.1.19
func NewPublishHostURLErr(message string) PublishHostURLErr
func (PublishHostURLErr) Error ¶ added in v0.1.19
func (p PublishHostURLErr) Error() string
type SubscribeHostURLErr ¶ added in v0.1.19
type SubscribeHostURLErr struct {
// contains filtered or unexported fields
}
func NewSubscribeHostURLErr ¶ added in v0.1.19
func NewSubscribeHostURLErr(message string) SubscribeHostURLErr
func (SubscribeHostURLErr) Error ¶ added in v0.1.19
func (p SubscribeHostURLErr) Error() string
type TlsConfigurationOptions ¶ added in v0.1.19
type TlsConfigurationOptions struct { SkipCertVerify bool CertFile string KeyFile string KeyPEMBlock string CertPEMBlock string }
func CreateDefaultTlsConfigurationOptions ¶ added in v0.1.19
func CreateDefaultTlsConfigurationOptions() TlsConfigurationOptions
type X509KeyLoader ¶ added in v0.1.19
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 ¶ added in v0.1.19
type X509KeyPairCreator func(certPEMBlock []byte, keyPEMBlock []byte) (tls.Certificate, error)
X509KeyPairCreator defines the function signature for creating a tls.Certificate based on PEM encoding.