apputil

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

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 GetEnv added in v0.0.10

func GetID added in v0.0.10

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)

func SetID added in v0.0.10

func SetID(appConfig *configpb.App)

Types

type AppConfig added in v0.0.10

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

func (*AppConfig) SetByPbApp added in v0.0.10

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