snippets

package
v0.0.0-...-8920fff Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MIT Imports: 1 Imported by: 0

README

Retrieving the values of environment variables and validating them is a common problem.

github.com/kelseyhightower/envconfig provides an easy and structured way of doing both of that.

It allows you to provide a configuration struct in which you can set:

  • expected names of the variables
  • expected types of values (e.g. int or []string)
  • whether a variable is required

More information available at godoc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Specification

type Specification struct {
	Regular              string
	Array                []int
	Map                  map[string]int
	SplitWithUnderscores int `split_words:"true"`
	WithDefaultValue     int `default:"42"`
	OverriddenName       int `envconfig:"MANUAL_OVERRIDE"`
	Required             int `required:"true"`
}

Jump to

Keyboard shortcuts

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