-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add properties and env vars resolution #89
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution. Please revert the package name paths. You changed Piszmog
to your username
Also, please elaborate further in the description of the PR. Provide documentation, examples, etc... The current description of the PR does not tell me what is going on, why this is an issue, and the different scenarios you would expect to see. |
Quality Gate passedIssues Measures |
Hi,
I did what you asked for.
Let me know if there's something else I must do
Have a nice day
Il 03/12/2024 05:06, Randell Callahan ha scritto:
… Also, please elaborate further in the description of the PR. Provide documentation, examples, etc...
—
Reply to this email directly, view it on GitHub <https://github.com/Piszmog/cloudconfigclient/
pull/89#issuecomment-2513503223>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/
AMOUL3ZTP6NQEUUH2NUQLIT2DUU5TAVCNFSM6AAAAABS3FUADOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJTGUYDGMRSGM>.
You are receiving this because you authored the thread. [Disarmed tracker from https://github.com/
notifications/beacon/
AMOUL3636DLLJHWHUHPF2QD2DUU5TA5CNFSM6AAAAABS3FUADOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUV2EB7O.gif] Message ID: ***@***.***>
--
Nicola Gaggi
Mobile +39 373 7826030
-----------------------------------------------
Net Service S.p.A.
Via Monte Grappa, 4/d - 40121 Bologna
Phone +39 051 6241989
Fax +39 051 6245947
The information transmitted is intended only for use by the addressee and may contain
confidential and/or privileged material. Any review, re-transmission, dissemination or
other use of it, or the taking of any action in reliance upon this information by persons
and/or entities other than the intended recipient is prohibited. If you received this in
error, please inform the sender and/or addressee immediately and delete the material.
Thank you.
|
Changes Description
Added the possibility to resolve values from other properties or environment variables using the placeholder ${<variable/property name>?(:)}.
During the unmarshalling of a configuration into a struct each property value is checked to find the presence of placeholders as the one showed above. Each placeholder is then substituted by the corresponding value of the property or environment variable, if defined, or the default value if specified. Otherwise the placeholder is left untouched.
For example the property value mongo://user:password@${mongo.database.host:localhost} will be resolved in
If there's no default value and the referenced property isn't defined the expression is left untouched.
Associated Issues
No conversion can be done on default values
Affected Files
configuration.go
configuration_test.go
Unit Tests Changed or Added
Added environment variables and properties resolution test case to TestSource_Unmarshal function in configuration_test.go