gestalt

package module
v0.0.0-...-7eb4ed3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2014 License: MIT Imports: 3 Imported by: 1

README

gestalt

Configuration for Golang

Documentation

Read the docs at http://godoc.org/github.com/cgarvis/gestalt

Usage

Defaults to looking for the environment varable with the same name. It expects the variable to be all caps and converts all . to _.

config := gestalt.New()

// Lookup for PORT
port := config.Int("port", 8080)

// Lookup for MONGO_URI
mongo_uri := config.String("mongo.uri", "localhost:27072")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

func New

func New() *Config

func (*Config) Bool

func (cfg *Config) Bool(name string, value bool) bool

Bool defines a bool config with specified name and default value. Config value can been "true", "false", "1", "0"

func (*Config) Float64

func (cfg *Config) Float64(name string, value float64) float64

Float64 defines a float64 config with specified name and default value.

func (*Config) Int

func (cfg *Config) Int(name string, value int) int

Int defines an integer config with specified name and default value.

func (*Config) Int64

func (cfg *Config) Int64(name string, value int64) int64

Int64 defines an int64 config with specified name and default value.

func (*Config) String

func (cfg *Config) String(name, value string) string

String defines a string config with specified name and default value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL