config

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Debug   = `debug`
	Release = `release`
)

Variables

View Source
var (
	Conf = new(conf)
)

Functions

func GetConf

func GetConf(serviceName string) interface{}

func Init

func Init(nodeConfigPath string)

func IsDebug

func IsDebug() bool

IsDebug 系统状态

func RegisterConf

func RegisterConf(cfgs ...*ConfInfo)

func SetStatus

func SetStatus(status string)

Types

type ConfInfo

type ConfInfo struct {
	ServiceName   string             // 服务名称
	ConfName      string             // 配置文件名称
	ConfPath      string             // 配置文件路径(这个路径是基于node.Start传入的路径)
	ConfType      string             // 配置文件类型
	Cfg           interface{}        // 配置结构体
	DefaultSetFun func(*viper.Viper) // 默认配置函数
}

Jump to

Keyboard shortcuts

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