Skip to content

alanhe/envparse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

envparse

Inspried by the idea of Store config in the environment from The Twelve-Factor App. The envparse lib aims to make reading environment varaibles easier.

Usage:

func main() {
    parser := envparse.New()

    parser.Add(&envparse.Param{Name: "DB_URL", Required: true})
    parser.Parse() // panic if DB_URL is not set

    dbURL := parser.GetString("DB_URL") // retive a trimmed value

    // ...
}

About

Read environment variables get easier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages