envutil

package
v0.0.80 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ModeKey       = "MODE"
	ModeValueProd = "production"
	ModeValueDev  = "development"
)

Variables

This section is empty.

Functions

func GetBool added in v0.0.17

func GetBool(key string, defaultValue bool) bool

func GetInt

func GetInt(key string, defaultValue int) int

func GetStr

func GetStr(key string, defaultValue string) string

func SetDevMode added in v0.0.78

func SetDevMode() error

SetDevMode sets the MODE environment variable to "development".

Types

type Base added in v0.0.78

type Base struct {
	Mode   string
	IsDev  bool
	IsProd bool
	Port   int
}

func InitBase added in v0.0.79

func InitBase(fallbackGetPortFunc func() int) (Base, error)

func (*Base) GetIsDev added in v0.0.78

func (e *Base) GetIsDev() bool

func (*Base) GetPort added in v0.0.78

func (e *Base) GetPort() int

type Env added in v0.0.78

type Env interface {
	GetIsDev() bool
	GetPort() int
}

Jump to

Keyboard shortcuts

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