goenvparse

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 4 Imported by: 0

README

goenvparse

Golang structure parser from environment variables and .env files with default values

Usage

package main

import "github.com/tsarbas/goenvparse"

type Config struct {
    Name    string `env:"TEST_NAME" default:"simple"`
    Number  int    `env:"TEST_NUMBER" default:"1"`
    Success bool   `env:"TEST_SUCCESS" default:"true"`
}

c := &Config{}
goenvparse.Parse(c, ".env", "/path/to/file")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(cfg interface{}, filenames ...string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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