envr

package module
v0.0.0-...-c737625 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: MIT Imports: 5 Imported by: 0

README

envr

Simple env return framework

Used package : https://github.com/joho/godotenv

Os Package

Usage

Import

go get github.com/alonzzio/envr
	directoryPath := "" // Your env files direcory. please add path with out '/'.
	err = envr.LoadEnv("directoryPath", "environment.env","environment1.env")
	if err != nil {
		return err
	}

This loads the files from the same location. Currently not supported from different folders/paths

key,_:=envr.GetString("JWTSecretKey")
fmt.Println(key)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(key string) (bool, error)

GetBoolean load from env file return as string

func GetInt

func GetInt(key string) (int, error)

GetInt load from env file return as int

func GetInt32

func GetInt32(key string) (int32, error)

GetInt32 load from env file return as int32

func GetInt64

func GetInt64(key string) (int64, error)

GetInt64 load from env file return as int64

func GetString

func GetString(key string) (string, error)

GetString load from env file return as string

func LoadEnv

func LoadEnv(envDirectory string, filenames ...string) error

LoadEnv loads env file from directory. Add env file containing folder and file name

func TestFunc

func TestFunc()

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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