Copyright | (c) Red Hat 2022 |
---|---|
License | Apache-2.0 |
Maintainer | tdecacqu@redhat.com, fboucher@redhat.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
This module contains the logic to decode configuration file content.
Synopsis
- type ConfigMap a b = Map a [(ConfigLoc, b)]
- data Config = Config {
- jobs :: ConfigMap JobName Job
- nodesets :: ConfigMap NodesetName Nodeset
- nodeLabels :: ConfigMap NodeLabelName NodeLabelName
- projects :: ConfigMap CanonicalProjectName Project
- projectRegexs :: ConfigMap ProjectRegex Project
- projectTemplates :: ConfigMap ProjectTemplateName ProjectTemplate
- pipelines :: ConfigMap PipelineName Pipeline
- secrets :: ConfigMap SecretName SecretName
- queues :: ConfigMap QueueName QueueName
- semaphores :: ConfigMap SemaphoreName SemaphoreName
- triggers :: ConfigMap ConnectionName ConnectionName
- reporters :: ConfigMap ConnectionName ConnectionName
- configErrors :: [ConfigError]
- tenants :: Set TenantName
- data ConfigError
- loadConfig :: ConnectionUrlMap -> TenantResolver -> Either ConfigError ZKFile -> StateT Config IO ()
- mergeConfig :: Config -> Config -> Config
- emptyConfig :: Set TenantName -> Config
- data TenantResolver
- type ConnectionUrlMap = Map ProviderName ConnectionUrl
- decodeConfig :: (CanonicalProjectName, BranchName) -> Value -> [Decoder ZuulConfigElement]
The resulting configuration
type ConfigMap a b = Map a [(ConfigLoc, b)] Source #
A config map contains the list of every variants associated with their location.
The global configuration map.
Config | |
|
Instances
data ConfigError Source #
The list of config error that can happens when loading the configuration.
Instances
:: ConnectionUrlMap | The map of the connection urls. |
-> TenantResolver | The helper to resolve the matching tenant list. |
-> Either ConfigError ZKFile | The configuration object file to load. |
-> StateT Config IO () | The computation to update the config. |
The main function to decode a ZKFile
mergeConfig :: Config -> Config -> Config Source #
Merge two configurations by assigning unique tenant names.
emptyConfig :: Set TenantName -> Config Source #
An empty config.
data TenantResolver Source #
Tenant information to resolve project location
type ConnectionUrlMap = Map ProviderName ConnectionUrl Source #
Convenient alias
Test helper
decodeConfig :: (CanonicalProjectName, BranchName) -> Value -> [Decoder ZuulConfigElement] Source #
Low level helper to decode a config file into a list of ZuulConfigElement
.