Skip to content

lostghost/gofig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

gofig

Golang configuration library for building friendly, easy to develop and configure 12-factor apps.

For development it is easiest to have local environment configuration files. This makes it easy to run the application locally durring development, however, upon moving to production, we really want to be configuring the application via env vars.

Gofig is a library designed to abstract the configuration process to allow several methods of providing the application configuration so that we can move our application from convenient local development to secure and flexible production configuration.

Possible methods for providing configuration include:

  • configuration file(s)
  • env vars
  • command line flags

Usage

import github.com/lostghost/gofig

var config struct {
    env string
    port int
}

gofig.RegisterConfigfile('./config.yaml', false)
gofig.String(&config.env, 'ENV', 'Application Environment', 'development')
gofig.Integer(&config.port, 'SERVER_PORT', 'Server Port', 8080)
gofig.Parse()

Configuration File Formats

TBD: INI, YAML, TOML, JSON?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages