go[channels]: hot config reload with os signal

Imagine a scenario where you have a monolithic application which uses a config file to store information about log directories, cert dirs and other service information. As an example to it following config file (- it is taken and modified from Haaukins project which I work on- ) can be considered: host: http: myapplication.mrturkmen.com port: insecure: 8080 secure: 8081 tls: enabled: false certfile: "/home/mrturkmen/certs/cert.crt" certkey: "/home/mrturkmen/certs/cert.key" cafile: "/home/mrturkmen/certs/ca.crt" files: ova-directory: "/home/mrturkmen/ova" users-file: "/home/mrturkmen/configs/users.yml" exercises-file: "/home/mrturkmen/configs/exercises.yml" frontends-file: "/home/mrturkmen/configs/frontends.yml" prodmode: true vpn-service: grpc: "vpnservice.mrturkmen.com:4000" auth-key: random-auth-key sign-key: random-sign-key tls: enabled: true certfile: "/home/mrturkmen/certs/cert.crt" certkey: "/home/mrturkmen/certs/cert.key" cafile: "/home/mrturkmen/certs/ca.crt" In this config file we have some set of keys which are defined to be used inside the application, however let’s say we would like to update some values from the config file. Then in normal cases (-if no hot reload kind of function implemented- ), user needs to restart entire application. It means application will have some down time, it may be less or more however it is not good way of doing it, in particular to update only a value from config file. ...

April 18, 2021 · 3 min · mrturkmen