common

package
v2.0.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicBool

type AtomicBool struct {
	// contains filtered or unexported fields
}

func (*AtomicBool) Set

func (b *AtomicBool) Set(v bool)

func (*AtomicBool) Value

func (b *AtomicBool) Value() bool

type ConfigurationStruct

type ConfigurationStruct struct {
	// Writable contains the configuration that change be change on the fly
	Writable WritableInfo
	// Registry contains the configuration for connecting the Registry service
	Registry bootstrapConfig.RegistryInfo
	// Service contains the standard 'service' configuration for the Application service
	Service bootstrapConfig.ServiceInfo
	// HttpServer contains the configuration for the HTTP Server
	HttpServer HttpConfig
	// Trigger contains the configuration for the Function Pipeline Trigger
	Trigger TriggerInfo
	// ApplicationSettings contains the custom configuration for the Application service
	ApplicationSettings map[string]string
	// Clients contains the configuration for connecting to the dependent Edgex clients
	Clients map[string]bootstrapConfig.ClientInfo
	// Database contains the configuration for connection to the Database
	Database db.DatabaseInfo
	// SecretStore contains the configuration for connection to the Secret Store when in secure mode
	SecretStore bootstrapConfig.SecretStoreInfo
}

ConfigurationStruct swagger:model ConfigurationStruct

func (*ConfigurationStruct) EmptyWritablePtr

func (c *ConfigurationStruct) EmptyWritablePtr() interface{}

EmptyWritablePtr returns a pointer to an empty WritableInfo struct. It is used by the bootstrap to provide the appropriate structure for Config Client's WatchForChanges().

func (*ConfigurationStruct) GetBootstrap

GetBootstrap returns the configuration elements required by the bootstrap.

func (*ConfigurationStruct) GetInsecureSecrets

func (c *ConfigurationStruct) GetInsecureSecrets() bootstrapConfig.InsecureSecrets

GetInsecureSecrets returns the service's InsecureSecrets.

func (*ConfigurationStruct) GetLogLevel

func (c *ConfigurationStruct) GetLogLevel() string

GetLogLevel returns log level from the configuration

func (*ConfigurationStruct) GetMessageBusInfo

func (c *ConfigurationStruct) GetMessageBusInfo() bootstrapConfig.MessageBusInfo

GetMessageBusInfo returns dummy MessageBusInfo since SDK doesn't use MessageBusInfo

func (*ConfigurationStruct) GetRegistryInfo

func (c *ConfigurationStruct) GetRegistryInfo() bootstrapConfig.RegistryInfo

GetRegistryInfo returns the RegistryInfo section from the configuration

func (*ConfigurationStruct) UpdateFromRaw

func (c *ConfigurationStruct) UpdateFromRaw(rawConfig interface{}) bool

UpdateFromRaw converts configuration received from the registry to a service-specific configuration struct which is then used to overwrite the service's existing configuration struct.

func (*ConfigurationStruct) UpdateWritableFromRaw

func (c *ConfigurationStruct) UpdateWritableFromRaw(rawWritable interface{}) bool

UpdateWritableFromRaw updates the Writeable section of configuration from raw update received from Configuration Provider.

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials encapsulates username-password attributes.

type ExternalMqttConfig

type ExternalMqttConfig struct {
	// Url contains the fully qualified URL to connect to the MQTT broker
	Url string
	// SubscribeTopics is a comma separated list of topics in which to subscribe
	SubscribeTopics string
	// PublishTopic is the topic to publish pipeline output (if any)
	PublishTopic string
	// ClientId to connect to the broker with.
	ClientId string
	// ConnectTimeout is a time duration indicating how long to wait timing out on the broker connection
	ConnectTimeout string
	// AutoReconnect indicated whether or not to retry connection if disconnected
	AutoReconnect bool
	// KeepAlive is seconds between client ping when no active data flowing to avoid client being disconnected
	KeepAlive int64
	// QoS for MQTT Connection
	QoS byte
	// Retain setting for MQTT Connection
	Retain bool
	// SkipCertVerify indicates if the certificate verification should be skipped
	SkipCertVerify bool
	// SecretPath is the name of the path in secret provider to retrieve your secrets
	SecretPath string
	// AuthMode indicates what to use when connecting to the broker. Options are "none", "cacert" , "usernamepassword", "clientcert".
	// If a CA Cert exists in the SecretPath then it will be used for all modes except "none".
	AuthMode string
}

ExternalMqttConfig contains the MQTT broker configuration for MQTT Trigger

type HttpConfig

type HttpConfig struct {
	// Protocol is the for the HTTP Server to use HTTP or HTTPS
	// If HTTPS then the Secret store must contain the HTTPS cert and key
	Protocol string
	// SecretName is the name in the secret store for the HTTPS cert and key
	SecretName string
	// HTTPSCertName is name of the HTTPS cert in the secret store
	HTTPSCertName string
	// HTTPSKeyName is name of the HTTPS key in the secret store
	HTTPSKeyName string
}

HttpConfig contains the addition configuration for HTTP Server

type MessageBusConfig

type MessageBusConfig struct {
	// SubscribeHost contains the connection information for subscribing to the MessageBus
	SubscribeHost SubscribeHostInfo
	// PublishHost contains the connection information for a publishing to the MessageBus
	PublishHost PublishHostInfo
	// Type indicates the message queue platform being used. eg. "redis", "mqtt" or "zero"
	Type string
	// Optional contains all other properties of MessageBus that is specific to
	// certain concrete implementation like MQTT's QoS, for example
	Optional map[string]string
}

MessageBusConfig defines the messaging information need to connect to the MessageBus in a publish-subscribe pattern

type PipelineFunction

type PipelineFunction struct {
	// Name	string
	Parameters map[string]string
}

type PipelineInfo

type PipelineInfo struct {
	ExecutionOrder           string
	UseTargetTypeOfByteArray bool
	Functions                map[string]PipelineFunction
}

type PublishHostInfo

type PublishHostInfo struct {
	// Host is the hostname or IP address of the messaging broker, if applicable.
	Host string
	// Port defines the port on which to access the message queue.
	Port int
	// Protocol indicates the protocol to use when accessing the message queue.
	Protocol string
	// PublishTopic is the topic in which to publish pipeline output (if any)
	PublishTopic string
}

PublishHostInfo is the host information for connecting and publishing to the MessageBus

type StoreAndForwardInfo

type StoreAndForwardInfo struct {
	Enabled       bool
	RetryInterval string
	MaxRetryCount int
}

type SubscribeHostInfo

type SubscribeHostInfo struct {
	// Host is the hostname or IP address of the messaging broker, if applicable.
	Host string
	// Port defines the port on which to access the message queue.
	Port int
	// Protocol indicates the protocol to use when accessing the message queue.
	Protocol string
	// SubscribeTopics is a comma separated list of topics in which to subscribe
	SubscribeTopics string
}

SubscribeHostInfo is the host information for connecting and subscribing to the MessageBus

type TriggerInfo

type TriggerInfo struct {
	// Type of trigger to start pipeline
	// enum: http, edgex-messagebus, or external-mqtt
	Type string
	// Used when Type=edgex-messagebus
	EdgexMessageBus MessageBusConfig
	// Used when Type=external-mqtt
	ExternalMqtt ExternalMqttConfig
}

TriggerInfo contains Metadata associated with each Trigger

type WritableInfo

type WritableInfo struct {
	// Set level of logging to report
	//
	// example: TRACE
	// required: true
	// enum: TRACE,DEBUG,INFO,WARN,ERROR
	LogLevel        string
	Pipeline        PipelineInfo
	StoreAndForward StoreAndForwardInfo
	InsecureSecrets bootstrapConfig.InsecureSecrets
}

WritableInfo is used to hold configuration information that is considered "live" or can be changed on the fly without a restart of the service.

Jump to

Keyboard shortcuts

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