env

package
v0.0.0-...-68c1abf Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 2 Imported by: 0

README

env

-- import "github.com/rickbassham/example-go/pkg/env"

Usage

func Load
func Load(c interface{}) error

Load will bind the environment variables to the given config.

type Config
type Config struct {
	AppName         string    `env:"APP_NAME,required"`
	Environment     string    `env:"APP_ENV,required"`
	BuildDate       time.Time `env:"BUILD_DATE"`
	BuildGitHash    string    `env:"BUILD_GIT_HASH,required"`
	BuildGitTag     string    `env:"BUILD_GIT_TAG,required"`
	NewRelicLicense string    `env:"NEW_RELIC_LICENSE,required"`
}

Config represents the common environment variables needed for all apps.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(c interface{}) error

Load will bind the environment variables to the given config.

Types

type Config

type Config struct {
	AppName         string    `env:"APP_NAME,required"`
	TeamName        string    `env:"TEAM_NAME,required"`
	Environment     string    `env:"APP_ENV,required"`
	BuildDate       time.Time `env:"BUILD_DATE"`
	BuildGitHash    string    `env:"BUILD_GIT_HASH,required"`
	BuildGitTag     string    `env:"BUILD_GIT_TAG,required"`
	NewRelicLicense string    `env:"NEW_RELIC_LICENSE,required"`
}

Config represents the common environment variables needed for all apps.

Jump to

Keyboard shortcuts

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