Documentation
¶
Overview ¶
Package config defines DDA configuration types to be used programmatically or within a DDA configuration file in YAML format.
Note that the fields of all configuration types are not documented in code but solely in the default DDA YAML configuration file located in the project root folder (single source of truth).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateName ¶
Asserts that the given name conforms to the DDA naming convention for configuration items used as pub-sub topic fields. Such a name must be non-empty and only contain ASCII digits 0-9, lowercase letters a-z, uppercase letters A-Z, dot (.), hyphen (-), or underscore (_). Returns an error if assertion fails; nil otherwise.
This function is intended to be used by communication binding implementations.
func ValidateNonEmpty ¶
Asserts that the given value is a non-empty string. Returns an error if assertion fails; nil otherwise. The given context strings are embedded into the error.
Types ¶
type AuthOptions ¶
type AuthOptions struct { Method string Cert string Key string Verify bool Username string Password string }
AuthOptions defines authentication options for a selected pub-sub messaging protocol.
type Config ¶
type Config struct { Version string Identity Identity Cluster string Apis ConfigApis Services ConfigServices }
A Config represents the complete hierarchy of configuration parameters for all DDA services as nested struct types that map to the underlying YAML configuration schema. It should be created with New() or ReadConfig() to ensure all fields are correctly populated.
func New ¶
func New() *Config
New creates a Config struct pre-filled with default values as specified in the YAML DDA configuration format.
func ReadConfig ¶
ReadConfig reads and parses the given DDA configuration file in YAML format and returns a *Config on success or an error, otherwise.
type ConfigApi ¶
A ConfigApi comprises server-side configuration options of a specific public DDA Client API.
type ConfigApis ¶
type ConfigApis struct { Grpc ConfigApi GrpcWeb ConfigWebApi `yaml:"grpc-web"` Cert string Key string }
ConfigApis comprises server-side configuration options of all public DDA Client APIs.
type ConfigComService ¶
type ConfigComService struct { Protocol string Url string Auth AuthOptions Opts map[string]any Disabled bool }
ConfigComService defines configuration options for a selected pub-sub messaging protocol.
type ConfigServices ¶
type ConfigServices struct { Com ConfigComService Store ConfigStoreService State ConfigStateService }
ConfigServices provides configuration options for all peripheral DDA services.
type ConfigStateService ¶ added in v0.42.0
type ConfigStateService struct { Protocol string Store string Bootstrap bool Disabled bool Opts map[string]any }
ConfigStateService provides configuration options for a selected consensus protocol.
type ConfigStoreService ¶ added in v0.41.0
ConfigStoreService provides configuration options for a selected local key-value storage.
type ConfigWebApi ¶
type ConfigWebApi struct { Address string Disabled bool AccessControlAllowOrigin []string `yaml:"access-control-allow-origin"` }
A ConfigApi used by Web HTTP clients.