pEnv

package module
v0.0.0-...-1907b39 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvP

type EnvP interface {
	CmdFromMap(envMap map[string]string, cmd string, cmdArgs []string)
	CmdFromFile(envFile string, cmd string, cmdArgs []string)
}

func Init

func Init(processStartupTime time.Duration) EnvP

Init pEnv with the time taken by processes to read env. Each process is launched in a go routine. After processStartupTime duration, the env will be cleared

Eg.

func main(){
   pEnv := pEnv.Init(time.Millisecond * 3)
   pEnv.CmdFromFile(".env", "./main", nil)
   pEnv.CmdFromMap(map[string]string{"HTTP_PORT": "7001", "HOST": "localhost"}, "./main", nil)
   <- make(chan bool)
}

Jump to

Keyboard shortcuts

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