Skip to content

auroratechnologies/jsonconf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonConf GoDoc

######JsonConf

JsonConf implements a method of reading environment variables and defaulting to a configuration json file if the environment variable is not found.

This helps setup a single configuration file that can be used in production, development and local environments, while all having different configurations if the appropriate environment variables are setup.

###Full example

package main

import (
	"fmt"
	"github.com/auroratechnologies/jsonconf"
)


func main() {
	jsonconf.LoadConfig("conf.json")
	redisaddr, err := jsonconf.GetVar("REDIS_ADDR"))
	if (err != nil){
		fmt.Println(err) // No key found
	}
	fmt.Println(redisaddr)
}

Full package and usage documentation can be located at the godocs site.

About

A simple library for handling server configuration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages