Skip to content

dungps/config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Config

Go config is a simple configuration solution for Go application using Viper and Consul KV

  • Reading config from file or Consul KV
  • Support JSON, TOML, YAML, HCL, envfile and Java properties config files

Install

go get github.com/dungps/config

How to use

  1. Reading config from file
err := config.LoadConfigFrom(config.FileType, "./sample.yaml")
if err != nil {
    // handle err
}

viper.GetBool("hello")
  1. Reading config from Consul KV
err := config.LoadConfigFrom(config.ConsulType, "/sample.yaml,/local.yaml")
if err != nil {
    // handle err
}

viper.GetBool("hello")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages