runenv

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Domain                 = "lug"
	CatchSigpipe           = true
	Block                  = true
	Trace                  = false
	Addr                   = ":8080"
	Project                = "lug"
	Level                  = "debug"
	Mode                   = "dev"
	Signal       os.Signal = syscall.Signal(0)
)

默认的全局配置

View Source
var (
	RunMode_name = map[int32]string{
		0: "dev",
		1: "test",
		2: "stag",
		3: "prod",
		4: "release",
		5: "unknown",
	}
	RunMode_value = map[string]int32{
		"dev":     0,
		"test":    1,
		"stag":    2,
		"prod":    3,
		"release": 4,
		"unknown": 5,
	}
)

Enum value maps for RunMode.

View Source
var File_runmode_proto protoreflect.FileDescriptor

Functions

func CheckMode

func CheckMode() bool

CheckMode 运行环境检查

func DefaultFlags

func DefaultFlags() *pflag.FlagSet

func IsDev

func IsDev() bool

func IsProd

func IsProd() bool

func IsRelease

func IsRelease() bool

func IsStag

func IsStag() bool

func IsTest

func IsTest() bool

Types

type RunMode

type RunMode int32
const (
	RunMode_dev     RunMode = 0
	RunMode_test    RunMode = 1
	RunMode_stag    RunMode = 2
	RunMode_prod    RunMode = 3
	RunMode_release RunMode = 4
	RunMode_unknown RunMode = 5
)

func (RunMode) Descriptor

func (RunMode) Descriptor() protoreflect.EnumDescriptor

func (RunMode) Enum

func (x RunMode) Enum() *RunMode

func (RunMode) EnumDescriptor deprecated

func (RunMode) EnumDescriptor() ([]byte, []int)

Deprecated: Use RunMode.Descriptor instead.

func (RunMode) Number

func (x RunMode) Number() protoreflect.EnumNumber

func (RunMode) String

func (x RunMode) String() string

func (RunMode) Type

func (RunMode) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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