apputil

package
v0.3.35 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const (
	RedisSep = ":"
	PathSep  = "/"
)

Variables

This section is empty.

Functions

func AbsPath

func AbsPath(appConfig *AppConfig) string

func ClientDecoderEncoder

func ClientDecoderEncoder() []http.ClientOption

ClientDecoderEncoder ...

func CurrentPath

func CurrentPath() string

CurrentPath ...

func GetConfig

func GetConfig() (*configpb.Bootstrap, error)

func GetID

func GetID() string

func ID

func ID(appConfig *AppConfig) string

ID 程序ID 例:go-srv-saas:user-service:DEVELOP:v1.0.0

func Identifier

func Identifier(appConfig *AppConfig, sep string) string

Identifier app 唯一标准 @result = app.ProjectName + "/" + app.ServerName + "/" + app.ServerEnv + "/" + app.ServerVersion

func IsDebugMode

func IsDebugMode() bool

func IsLocalMode

func IsLocalMode() bool

func Path

func Path(appConfig *AppConfig) string

func RuntimePath

func RuntimePath() (string, error)

RuntimePath ...

func ServerDecoderEncoder

func ServerDecoderEncoder() []http.ServerOption

ServerDecoderEncoder ...

func SetConfig

func SetConfig(bootstrap *configpb.Bootstrap)

Types

type AppConfig

type AppConfig struct {
	ProjectName   string //
	ServerName    string //
	ServerEnv     string // 开发环境;值:DEVELOP、TESTING、PREVIEW、PRODUCTION
	ServerVersion string //
}

func ToAppConfig

func ToAppConfig(appConfig *configpb.App) *AppConfig

func (*AppConfig) SetByPbApp

func (a *AppConfig) SetByPbApp(appConfig *configpb.App)

Jump to

Keyboard shortcuts

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