Skip to content

Removed .missy.yml and config package

Latest
Compare
Choose a tag to compare
@slot slot released this 19 Nov 12:21
· 21 commits to master since this release

Remove .missy.yml file. Registering configuration parameters is now done in code, as the .missy.yml file contained static information anyway. The config functionality moved to the service. The config is currently held in a singleton which prevents parallel testing in favour to easy access but we have plans to put it in the request context. Nevertheless this is the current evolution.

To register config parameters we now have these two shorthands, ideally placed as the first thing in your main file

service.Config().RegisterOptionalParameter(envName, default, internalName, usageDescription)
service.Config().RegisterMandatoryParameter(envName, internalName, usageDescription)
service.Config().Parse()

The behaviour remains the same, the program will die on startup if a mandatory parameter has not been set, it will log an info message if the optional parameter is using the default.

The Parse() function can now be called multiple times because if we will store information about what parameters have been parsed already. This is important because certain parts of missy (e.g. messaging) bring their own configuration and call Parse() as well.