env

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(envs ...Env) bool

func IsDebug

func IsDebug() bool

func IsDev

func IsDev() bool

func IsProd

func IsProd() bool

func IsStage

func IsStage() bool

func IsUseString

func IsUseString(envs ...string) bool

func NewContext

func NewContext(ctx context.Context, env Env) context.Context

func Provider

func Provider(env Env) func(ctx context.Context) error

func SetEnv

func SetEnv(env Env)

Types

type Env

type Env string
var (
	Dev   Env = "dev"
	Prod  Env = "prod"
	Debug Env = "debug"
	Stage Env = "stage"
)

func FromContext

func FromContext(ctx context.Context) (Env, bool)

func GetEnv

func GetEnv() Env

func (Env) String

func (e Env) String() string

Jump to

Keyboard shortcuts

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