Skip to content

finesse-fingers/go-appsettings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-appsettings

App settings for Golang applications

Install

If you have Go installed and configured (i.e. with $GOPATH/bin in your $PATH):

go get -u github.com/bkot88/go-appsettings

Usage

package main

import (
	"log"

	"github.com/bkot88/go-appsettings"
)

func main() {
	builder := appsettings.NewConfigurationBuilder()
	builder.AddEnvironmentVariables()
	builder.AddJSONFile("appsettings.local.json")
	builder.AddInMemoryCollection(map[string]interface{}{"hello:world": "world"})
	configuration := builder.Build()

	log.Println(configuration.GetValue("HOME"))
	log.Println(configuration.GetValue("hello:world"))
	log.Println(configuration.GetValue("hello__world"))
	log.Println(configuration.GetValue("connectionString"))
}

About

App settings for Golang applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages