config

package
v0.0.0-...-cab0b4b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvTesting    = "testing"
	EnvLocal      = "local"
	EnvProduction = "production"
)

Environment types.

Variables

View Source
var Config = &Configuration{}

Config is the global configuration instance.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Hostname string `json:"hostname"`
	Port     uint32 `json:"port"`
	Database string `json:"database"`
	LogLevel string `json:"log_level"`
	Username string `json:"username"`
	Password string `json:"password"`

	Environment string `json:"environment"`
}

Configuration contains all configuration parameters.

func NewConfigFromFile

func NewConfigFromFile(file string) (config *Configuration, err error)

NewConfigFromFile creates a new configuration from a JSON file.

func (*Configuration) IsEnvLocal

func (c *Configuration) IsEnvLocal() bool

IsEnvLocal Returns whether we are in this environment.

func (*Configuration) IsEnvProduction

func (c *Configuration) IsEnvProduction() bool

IsEnvProduction Returns whether we are in this environment.

func (*Configuration) IsEnvTesting

func (c *Configuration) IsEnvTesting() bool

IsEnvTesting Returns whether we are in this environment.

Jump to

Keyboard shortcuts

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