config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AliasDef = "default-log" // 框架初始化时已使用
)

Variables

This section is empty.

Functions

func GetEnvironment

func GetEnvironment() string

环境标识 默认路径 /xml/Environment

func GetLogColor

func GetLogColor() bool

Log Color

func GetLogLevel

func GetLogLevel() string

Log Level

func GetLogLineSize

func GetLogLineSize() int

Log LineSize

func GetLogMaxDays

func GetLogMaxDays() int

Log MaxDays

func GetLogMaxSize

func GetLogMaxSize() int64

Log MaxSize

func GetLogPath

func GetLogPath() string

Log Path

func GetLogSuffix

func GetLogSuffix() string

Log Suffix

func GetReportLevel

func GetReportLevel() string

////////////////////////////////////// Report Level

func GetReportLineSize

func GetReportLineSize() int

Report LineSize

func GetReportMaxDays

func GetReportMaxDays() int

Report MaxDays

func GetReportMaxSize

func GetReportMaxSize() int64

Report MaxSize

func GetReportPath

func GetReportPath() string

Report Path

func GetReportSuffix

func GetReportSuffix() string

Report Suffix

func GetSerLogFileName

func GetSerLogFileName() string

获取本应用的 LogFileName

func GetServerId

func GetServerId() int

获取本应用的 ServerId

func GetServerIdStr

func GetServerIdStr() string

func GetServerName

func GetServerName() string

获取本应用的 ServerName

func GetServerPort

func GetServerPort() int

获取本应用的 ServerPort

func GetStatChanLen

func GetStatChanLen() int

Stat Chan len

func GetStatDelayUp

func GetStatDelayUp() int

Stat DelayUp

func GetStatDelayUp2

func GetStatDelayUp2() int

Stat DelayUp2

func GetStatDelayUp3

func GetStatDelayUp3() int

Stat DelayUp3

func GetStatInterval

func GetStatInterval() int

func GetStatLevel

func GetStatLevel() string
***** stat  config ******

stat Level

func GetStatLineSize

func GetStatLineSize() int

Stat LineSize

func GetStatMaxDays

func GetStatMaxDays() int

Stat MaxDays

func GetStatMaxSize

func GetStatMaxSize() int64

Stat MaxSize

func GetStatPath

func GetStatPath() string

stat Path

func GetStatSuffix

func GetStatSuffix() string

Stat Suffix

func GetViperHandle

func GetViperHandle(alias string) *viper.Viper

func GetXmlConfigElement

func GetXmlConfigElement(alias, xpath string) ([]*etree.Element, error)

获取xml配置信息

func GetXmlConfigHandle

func GetXmlConfigHandle(alias string) *etree.Document

获取解析xml文件的句柄 alias: 解析多个xml文件时,用于区分。alias为空是,使用默认名[default]

func GetXmlConfigInt

func GetXmlConfigInt(alias, xpath string) (int, error)

获取xml配置信息 int

func GetXmlConfigStr

func GetXmlConfigStr(alias string) string

获取全部配置信息

func GetXmlConfigText

func GetXmlConfigText(alias, xpath string) (string, error)

获取xml配置信息 string

func GetXmlConfigTextList

func GetXmlConfigTextList(alias, xpath string) ([]string, error)

获取xml配置信息

func GetXmlRootPathElement

func GetXmlRootPathElement(tag string) string

获取xml配置信息 获取root层级下的对象配置信息

func GetZipkinLevel

func GetZipkinLevel() string

////////////////////////////////////// Zipkin Level

func GetZipkinLineSize

func GetZipkinLineSize() int

Zipkin LineSize

func GetZipkinMaxDays

func GetZipkinMaxDays() int

Zipkin MaxDays

func GetZipkinMaxSize

func GetZipkinMaxSize() int64

Zipkin MaxSize

func GetZipkinPath

func GetZipkinPath() string

Zipkin Path

func GetZipkinSuffix

func GetZipkinSuffix() string

Zipkin Suffix

func InitConfigViper

func InitConfigViper(name, path, confType, alias string, watcher bool) error

获取配置信息Viper name: 不需要后缀名 path: 可以是绝对路径,也可以相对路径 confType: "json", "toml", "yaml", "yml", "properties", "props", "prop", "hcl", "tfvars", "dotenv", "env", "ini" alias: 配置别名,区分多配置,必填不能为空

func InitFrameworkConfig

func InitFrameworkConfig(path, alias string, watcher bool) error

func InitXmlConfig

func InitXmlConfig(path, alias string, watcher bool) error

解析xml文件 path: xml文件路径 alias: 解析多个xml文件时,用于区分。alias为空是,使用默认名[default] watcher: 是否监控并重载文件变更

func IsTest

func IsTest() bool

默认路径 /xml/Server/Environment

func NewViper

func NewViper() *viper.Viper

获取配置信息Viper New Viper

Types

This section is empty.

Jump to

Keyboard shortcuts

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