config

package
v0.0.0-...-ed9fe1d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package config provies configuraiton access functions

Index

Constants

This section is empty.

Variables

View Source
var EnvVar = keyvalue.NewList(&envVar{})

EnvVar implements keyvalue.Getter for environment variables. It converts the keys into the actual environment variable names by following convensions.

  • Every single char is converted to the upper case.
  • key `abc` is converted as `ABC` environment variable name.
  • non-alphabetical chars nor non-digits are converted to '_'
  • key `abc.c` is `ABC_C`
  • key `abc-bar` is `ABC_BAR`

Functions

func Get

func Get(key string) (interface{}, error)

Get returns a value from the default config list

func GetIntOr

func GetIntOr(key string, or int) int

GetIntOr is a int version of GetOr

func GetOr

func GetOr(key string, or interface{}) interface{}

GetOr returns a value from the default config list or a default value if not found.

func GetStringOr

func GetStringOr(key string, or string) string

GetStringOr is a string version of GetOr

func Setup

func Setup(g ...keyvalue.Getter)

Setup initialize the Getters for Get* funcitons

Types

This section is empty.

Jump to

Keyboard shortcuts

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