Good day for all readers!
I have api service which needs key for some decrypt issues. Key calculates all time when I make request. That is wrong from an architectural point of view.
The option with environments (.env, viper...) drops because, in the future, I want to bring out this module to a separate library.
Hint me, how it is possible without using environments to calculate the key when starting the application and use it until stopping the application?
init()
function to calculate / initialize it. Although it's better to not have "global" variables, it's better to have some kind of application context where you can store global state.