config

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MIT Imports: 9 Imported by: 91

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvPathVar = "ENV_PATH"
	LocalPath  = "./.env"
)

Functions

func DefaultPaths

func DefaultPaths() []string

func EnvFileToJSONFile

func EnvFileToJSONFile(data interface{}, filepathENV, filepathJSON string, perm os.FileMode, prefix, indent string) error

EnvFileToJSONFile Converts an .env file to a JSON file using the definition provided in data.

func GetDotEnvVal

func GetDotEnvVal(envPath, varName string) (string, error)

GetDotEnvVal retrieves a single var from a `.env` file path

func JoinEnvNumbered

func JoinEnvNumbered(prefix, delimiter string, startInt uint8, includeBase bool) string

Return a merged environment var which is split into multiple vars. This is useful when the system has a size limit on environment variables.

func LoadDotEnv

func LoadDotEnv(paths ...string) ([]string, error)

func LoadDotEnvFirst

func LoadDotEnvFirst(paths ...string) error

func LoadDotEnvSkipEmpty

func LoadDotEnvSkipEmpty(paths ...string) error

func LoadDotEnvSkipEmptyInfo

func LoadDotEnvSkipEmptyInfo(paths ...string) ([]string, error)

func LoadEnvDefaults

func LoadEnvDefaults() error

func LoadEnvPathsPrioritized

func LoadEnvPathsPrioritized(fixedPath, envPath string) error

LoadEnvPaths attempts to load an explicit, env and current path. It returns an error ifexplicit/env paths are present but do not exist or are empty. This is was designed to flexibly handle common .env file paths in a prioritzed and differentiated order.

Types

This section is empty.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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