config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ENV_DEV        = "dev"        //本地测试环境
	ENV_DOCKER     = "docker"     //docker模式
	ENV_PRODUCTION = "production" //正式环境
)
View Source
var DefaultConfig = &Config{
	Server:   server.DefaultConfig,
	Store:    make(map[string]*store.Config),
	Log:      &logger.Config{},
	Broker:   &broker.Config{},
	Registry: &naming.Config{},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Env        string
	Timezome   string //时区设置
	Timeformat string

	Server *server.Config
	Api    *api.Config

	Store map[string]*store.Config

	Log      *logger.Config
	Broker   *broker.Config
	Registry *naming.Config
}

公共配置模板

func LoadConfig

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

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

func ParseConfig

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

ParseConfig 解析

Jump to

Keyboard shortcuts

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