app

package
v0.0.0-...-fb5fdcc Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvName_name = map[int32]string{
		0: "prod",
		1: "uat",
		2: "sit",
		3: "test",
		4: "dev",
	}
	EnvName_value = map[string]int32{
		"prod": 0,
		"uat":  1,
		"sit":  2,
		"test": 3,
		"dev":  4,
	}
)

Enum value maps for EnvName.

View Source
var File_component_app_app_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type App

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

func New

func New(c *Config) *App

func (*App) GetConfig

func (a *App) GetConfig() *Config

func (*App) GetDebug

func (a *App) GetDebug() bool

func (*App) GetEnv

func (a *App) GetEnv() EnvName

func (*App) GetName

func (a *App) GetName() string

func (*App) GetProcess

func (a *App) GetProcess() *process

func (*App) GetPwdPath

func (a *App) GetPwdPath() string

func (*App) GetRootPath

func (a *App) GetRootPath() string

func (*App) GetRuntimePath

func (a *App) GetRuntimePath() string

func (*App) GetShortRuntimePath

func (a *App) GetShortRuntimePath() string

type Config

type Config struct {

	// debug 开启调试模式
	Debug bool `protobuf:"varint,1,opt,name=debug,proto3" json:"debug,omitempty"`
	// name 应用名称
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// env 应用环境
	Env EnvName `protobuf:"varint,3,opt,name=env,proto3,enum=component.app.EnvName" json:"env,omitempty"`
	// runtime_path 缓存文件目录
	RuntimePath string `protobuf:"bytes,4,opt,name=runtime_path,json=runtimePath,proto3" json:"runtime_path,omitempty"`
	// proxy 网络代理访问
	Proxy string `protobuf:"bytes,5,opt,name=proxy,proto3" json:"proxy,omitempty"`
	// pid 进程PID
	Pid string `protobuf:"bytes,6,opt,name=pid,proto3" json:"pid,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetDebug

func (x *Config) GetDebug() bool

func (*Config) GetEnv

func (x *Config) GetEnv() EnvName

func (*Config) GetName

func (x *Config) GetName() string

func (*Config) GetPid

func (x *Config) GetPid() string

func (*Config) GetProxy

func (x *Config) GetProxy() string

func (*Config) GetRuntimePath

func (x *Config) GetRuntimePath() string

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type EnvName

type EnvName int32
const (
	EnvName_prod EnvName = 0
	EnvName_uat  EnvName = 1
	EnvName_sit  EnvName = 2
	EnvName_test EnvName = 3
	EnvName_dev  EnvName = 4
)

func (EnvName) Descriptor

func (EnvName) Descriptor() protoreflect.EnumDescriptor

func (EnvName) Enum

func (x EnvName) Enum() *EnvName

func (EnvName) EnumDescriptor deprecated

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

Deprecated: Use EnvName.Descriptor instead.

func (EnvName) Number

func (x EnvName) Number() protoreflect.EnumNumber

func (EnvName) String

func (x EnvName) String() string

func (EnvName) Type

func (EnvName) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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