env

package
v2.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 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 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) Is added in v2.9.0

func (e Env) Is(envs ...Env) bool

func (Env) String

func (e Env) String() string

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider added in v2.11.0

func NewProvider(env Env) *Provider

func (*Provider) Bootstrap added in v2.11.0

func (p *Provider) Bootstrap(ctx context.Context) (context.Context, error)

func (*Provider) Terminate added in v2.11.0

func (p *Provider) Terminate(ctx context.Context) (context.Context, error)

Jump to

Keyboard shortcuts

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