runtime

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunLocalEnv = "local"
	RunTestEnv  = "test"
	RunProdEnv  = "prod"
)
View Source
const (
	UserId string = "User-Id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	CTX    context.Context
	Logger abstract.Logger
}

func (Context) Log

func (c Context) Log() abstract.Logger

func (Context) UserId

func (c Context) UserId() string

type Env

type Env struct {
	AppName       string
	RunEnv        RunEnv
	WorkDir       string
	BuildVersion  string
	VerifyLicense bool
	Keys          sync.Map
}

Env 全局环境变量

func NewEnv

func NewEnv(appName, version, verifyLicense string) *Env

func (*Env) SetDefaultWorkDir

func (e *Env) SetDefaultWorkDir() error

SetDefaultWorkDir 设置默认地址

type RunEnv

type RunEnv string

func NewRunEnv

func NewRunEnv(env string) RunEnv

func (RunEnv) String added in v0.1.1

func (e RunEnv) String() string

Jump to

Keyboard shortcuts

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