config

package
v2.0.0-dev.60 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 19

Documentation

Index

Constants

View Source
const DefaultHttpProtocol = "http"

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapConfiguration

type BootstrapConfiguration struct {
	Clients     map[string]ClientInfo
	Service     ServiceInfo
	Config      ConfigProviderInfo
	Registry    RegistryInfo
	SecretStore SecretStoreInfo
}

BootstrapConfiguration defines the configuration elements required by the bootstrap.

type CertKeyPair

type CertKeyPair struct {
	Cert string
	Key  string
}

CertKeyPair encapsulates public certificate/private key pair for an SSL certificate

type ClientInfo

type ClientInfo struct {
	// Host is the hostname or IP address of a service.
	Host string
	// Port defines the port on which to access a given service
	Port int
	// Protocol indicates the protocol to use when accessing a given service
	Protocol string
}

ClientInfo provides the host and port of another service in the eco-system.

func (ClientInfo) Url

func (c ClientInfo) Url() string

type ConfigProviderInfo

type ConfigProviderInfo struct {
	Host string
	Port int
	Type string
}

ConfigProviderInfo defines the type and location (via host/port) of the desired configuration provider (e.g. Consul, Eureka)

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials encapsulates username-password attributes.

type Database

type Database struct {
	Type    string
	Timeout int
	Host    string
	Port    int
	Name    string
}

type InsecureSecrets

type InsecureSecrets map[string]InsecureSecretsInfo

InsecureSecrets is used to hold the secrets stored in the configuration

type InsecureSecretsInfo

type InsecureSecretsInfo struct {
	Path    string
	Secrets map[string]string
}

InsecureSecretsInfo encapsulates info used to retrieve insecure secrets

type MessageBusInfo

type MessageBusInfo struct {
	// Indicates the message bus implementation to use, i.e. zero, mqtt, redisstreams...
	Type string
	// Protocol indicates the protocol to use when accessing the message bus.
	Protocol string
	// Host is the hostname or IP address of the broker, if applicable.
	Host string
	// Port defines the port on which to access the message bus.
	Port int
	// PublishTopicPrefix indicates the topic prefix the data is published to.
	PublishTopicPrefix string
	// SubscribeTopic indicates the topic in which to subscribe.
	SubscribeTopic string
	// AuthMode specifies the type of secure connection to the message bus which are 'none', 'usernamepassword'
	// 'clientcert' or 'cacert'. Not all option supported by each implementation.
	// ZMQ doesn't support any Authmode beyond 'none', RedisStreams only supports 'none' & 'usernamepassword'
	// while MQTT supports all options.
	AuthMode string
	// SecretName is the name of the secret in the SecretStore that contains the Auth Credentials. The credential are
	// dynamically loaded using this name and store the Option property below where the implementation expected to
	// find them.
	SecretName string
	// Provides additional configuration properties which do not fit within the existing field.
	// Typically the key is the name of the configuration property and the value is a string representation of the
	// desired value for the configuration property.
	Optional map[string]string
	// SubscribeEnabled indicates whether enable the subscription to the Message Queue
	SubscribeEnabled bool
}

MessageBusInfo provides parameters related to connecting to a message bus as a publisher

func (MessageBusInfo) URL

func (p MessageBusInfo) URL() string

URL constructs a URL from the protocol, host and port and returns that as a string.

type RegistryInfo

type RegistryInfo struct {
	// Host is the host name where the Registry client is running
	Host string
	// Port is the port number that the Registry client is listening
	Port int
	// Type is the type of Registry client to use, i.e. 'consul'
	Type string
}

RegistryInfo defines the type and location (via host/port) of the desired service registry (e.g. Consul, Eureka)

type SecretStoreInfo

type SecretStoreInfo struct {
	Type                    string
	Host                    string
	Port                    int
	Path                    string
	Protocol                string
	Namespace               string
	RootCaCertPath          string
	ServerName              string
	Authentication          types.AuthenticationInfo
	AdditionalRetryAttempts int
	RetryWaitPeriod         string

	// TokenFile provides a location to a token file.
	TokenFile string
	// contains filtered or unexported fields
}

SecretStoreInfo encapsulates configuration properties used to create a SecretClient.

type ServiceInfo

type ServiceInfo struct {
	// HealthCheckInterval is the interval for Registry heal check callback
	HealthCheckInterval string
	// Host is the hostname or IP address of the service.
	Host string
	// Port is the HTTP port of the service.
	Port int
	// ServerBindAddr specifies an IP address or hostname
	// for ListenAndServe to bind to, such as 0.0.0.0
	ServerBindAddr string
	// StartupMsg specifies a string to log once service
	// initialization and startup is completed.
	StartupMsg string
	// MaxResultCount specifies the maximum size list supported
	// in response to REST calls to other services.
	MaxResultCount int
	// MaxRequestSize defines the maximum size of http request body in bytes
	MaxRequestSize int64
	// RequestTimeout specifies a timeout (in milliseconds) for
	// processing REST request calls from other services.
	RequestTimeout string
}

ServiceInfo contains configuration settings necessary for the basic operation of any EdgeX service.

func (ServiceInfo) HealthCheck

func (s ServiceInfo) HealthCheck() string

HealthCheck is a URL specifying a health check REST endpoint used by the Registry to determine if the service is available.

func (ServiceInfo) Url

func (s ServiceInfo) Url() string

Url provides a way to obtain the full url of the host service for use in initialization or, in some cases, responses to a caller.

Jump to

Keyboard shortcuts

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