config

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ENV_DEBUG      = "debug"
	ENV_PRODUCTION = "production"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Environment string
	Org         string
	//ServerName string //服务名称--4-11改。通过app启动设置
	Port string //服务端口
	Xds  bool   //是否是xds类型

	Timezome   string //时区设置
	Timeformat string

	Mysql  *store.Config
	Redis  *store.Config
	Mongo  *store.Config
	Sqlite *store.Config

	FileServer *fileserver.Config
	Log        *logger.Config
	Broker     *broker.Config
	Registry   *naming.Config

	RpcServer map[string]*Server //rpc server
}

公共配置模板

func LoadConfig

func LoadConfig(config_file ...string) (*Config, error)

一般的,都会实现自己的config,这里当作参考 LoadConfig config

func ParseConfig

func ParseConfig(f string) (*Config, error)

ParseConfig 解析

type Server added in v0.0.6

type Server struct {
	Name string
	Host string
	Port string
	Auth string //[keyfilepath]:[key]:
}

Jump to

Keyboard shortcuts

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