Skip to content

lrsec/config-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

config-loader

load configs in different env

Usage

  1. define config files for different env in conf/
src
 |--your prject
        |--conf
             |--test
                 config.toml
             |--product
                 config.toml
             |--stage
                 config.toml
  1. define environment in servers:
// for test env
RUN_MODE = "test"

// for product env
RUN_MODE = "product"

// for stage env
RUN_MODE = "stage"
  1. load config in code
cfg, err := config.LoadToml(c, "config.toml")

product/config.toml will be load on product env server

test/config.toml for test env server

stage/config.toml for stage env server

About

util lib for our go projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages