Skip to content

maygli/dynamictags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamictags

Configuration reader. Configuration reader can read configuration from three sources. 1) Default value, 2) Environment variable 3) From json configuration file Configuration reader allows to have dynaic tags. I.e. tags which value depends on environment variable or dictionary value

For example for structure:

type TestStruct struct {
  Mode string  `env:`${SERVER_NAME}_MODE`
  Port int     `env:`${SERVER_NAME}_PORT`   
}

If environment variable 'SERVER_NAME' has value 'TEST' field 'Mode' will be processed in the follow way:

  1. Environment variable name will be calculated as TEST_MODE.
  2. Value of field 'Mode' will get from environment variable 'TEST_MODE' if defined

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages