Create config package
What we're after
We need to pass the following configuration to the service:
- Host (can be empty, still valid)
- Port (must not be empty; could have a default of 8080)
-
Reading frequencyEdit: hardcoding to hourly for now. - Log level (INFO default?)
The following do not need to be read in separately because their clients read conventional environment variables:
- Postgres environment variables (PG*)
- Cloud Foundry environment variables
Security considerations
None in scope. Sensitive envvar storage will be handled in product#3310.
Notes for implementers
- I suggest a new
internal/configpackage with aConfigstruct andNew() Configfunction. You could update run to accept a getenv function and pass that to the config package to enable easy testing.