## Configuration Center Relatedasjard:config: ## Consul configuration center related configurationconsul: ## Configuration center name ## Configuration that depends on asjard.stores.consul.clients.{cllient} # client: default ## Delimiter ## Delimiter between multiple keys in consul # delimiter: "/"
Configuration priority
Priority increases from top to bottom, multiple fields are separated by the Englishasjard.config.consul.delimiterseparator, do not end withasjard.config.consul.delimiterending
/{app}/configs/: Project-related global configuration
/{app}/configs/{env}/: Environment-related global configuration
If files exist under the same prefix, all configurations in the files have the priority of that prefix
It is recommended not to use key/value style and files at the same time, because they have the same priority under the same prefix, causing differences between startup configuration override and runtime configuration override logic
## Key/value style config examples.timeout is 5ms
/examples/configs/examples/timeout
5ms
## File style config examples.timeout is 6ms
/examples/configs/global.yaml
examples:
timeout: 6ms
# At startup, according to ASCII order, /examples/configs/examples/timeout is loaded first
# then /examples/configs/global.yaml is loaded and will override the previously loaded one
# So the examples.timeout you get is 6ms
# However
# when you modify it
# Because their values belong to the same priority, whichever you modify becomes the value you get
# If one day you modify /examples/configs/examples/timeout, it will be fine when fetched without restarting
# But after restarting the service you find it did not take effect, because the same configuration appeared in different files at the same priority
# Causing divergence between runtime logic and startup logic
import (
// Import consul config source
_ "github.com/asjard/asjard/pkg/config/consul"
)
// Other usage is the same as ETCD