Settings
A server's settings, such as its address, its mock files or its log level, come from four places, each overriding the ones before it:
- Code:
mockhttp.Setup()ormockgrpc.Setup(), such asSetup().Addr(":8080"). - A
.vlatterc.yaml,.vlatterc.ymlor.vlatterc.jsonfile in the working directory or intestdata. VLATTE_*environment variables.- Command-line flags, for the
vlattecommand.
Each setting has one key that the others derive from: log.level is log: {level: debug} in a file, VLATTE_LOG_LEVEL=debug and --log-level=debug.
yaml
# .vlatterc.yaml
addr: ":8080"
log:
level: debugServers in tests read the file and the environment too, unless Setup().ConfigSources() says otherwise.
- Configuration covers the sources in full: how values are written, the root and work directories, and the sources in tests.
- The settings reference lists every setting, with its flag, variable and file key.