Cfgu format represents a set of properties that define essential characteristics of a software configuration in Configu. These properties provide important metadata and constraints for a configuration key. When these properties are attached to a configuration key in a
ConfigSchema and utilized through any Configu interface (CLI/SDK), they enable important and repeated validation of configuration values, often implemented in the code.
- type: Specifies the data type that the configuration represents. This property is required.
- pattern: Allows you to define a regular expression that the configuration value must match. This property is optional and applicable when the type is set to Regex.
- default: Provides a default value for the configuration if it is not explicitly provided. This property is optional.
- required: Determines whether the configuration is required for the application to function correctly. When set to true, the configuration must be provided. This property is optional.
- depends: Specifies a list of other configurations that the current configuration depends on. This property is optional.
- template: Allows you to define Mustache templates that can be used to construct a templated value from other configuration values. This property is optional and applicable when the type is set to String.
- description: Provides a description of the configuration's role in the code. This property is optional.
These types cover a wide range of data formats commonly used in configuration settings. You can choose the appropriate type for each configuration value based on your application's requirements.
Configu supports the following types for configuration values:
- Boolean: Represents a binary value of true or false. Example:
- Number: Represents numeric data. Example:
- String: Represents textual data. Example:
- RegEx: Represents a configuration value that must match a specific regular expression pattern.
- Also requires
patternproperty to be specified. Example:
- Also requires
- UUID: Represents a universally unique identifier. Example: A UUID Value
- SemVer: Represents a semantic version number. Example:
- IPv4: Represents an IPv4 address. Example:
- IPv6: Represents an IPv6 address. Example:
- MACAddress: Represents a MAC Address. Example:
- Domain: Represents a domain name. Example:
- URL: Represents a URL. Example:
- MIMEType: Represents a MIME type. Example:
- ConnectionString: Represents a connection string. Example:
- DockerImage: Represents a docker image tag name. Example:
- Hex: Represents a value encoded in hexadecimal format. Example: A Hex Encoded Value
- Base64: Represents a value encoded in Base64 format. Example: A Base64 Encoded Value
- MD5: Represents a value hashed using MD5. Example: A MD5 Hashed Value
- SHA: Represents a value hashed using SHA. Example: A SHA Hashed Value
- Color: Represents a color value using hexadecimal notation, rgb/a notation or hsl notation. Example:
rgb(255, 255, 255),
hsl(0, 0%, 100%)
- Email: Represents an email address. Example:
- MobilePhone: Represents a phone number. Example:
+1 000 000 0000
- Locale: Represents a specific language and region combination. Example:
- LatLong: Represents latitude and longitude coordinates. Example:
41 24.2028, 2 10.4418
- Country: Represents a country code. Example:
- Language: Represents a language code. Example:
- Currency: Represents a currency code. Example:
- AWSRegion: Represents an AWS region. Example:
- AZRegion: Represents an Azure region. Example:
- GCPRegion: Represents a GCP region. Example:
- OracleRegion: Represents a Oracle Cloud region. Example:
- IBMRegion: Represents a IBM Cloud region. Example:
- AlibabaRegion: Represents a Alibaba Cloud region. Example:
- MongoId: Represents a MongoDB identifier. Example:
- DateTime: Represents a date/timestamp/hour. Example:
Configu is designed to be extensible, allowing you to add custom types as needed. If you require a type that is not currently supported, we encourage you to let us know or consider contributing it yourself. With Configu's flexibility, you can tailor the configuration system to suit your specific requirements.
Feel free to explore the available types and utilize them to define your configuration values accurately.