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 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址