config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDefaultConfig

func InitDefaultConfig(ConfigViper *viper.Viper)

InitDefaultConfig 配置配置项的默认值

func InitEnvConfig

func InitEnvConfig(ConfigViper *viper.Viper)

InitEnvConfig 从环境变量获得的配置内容初始化配置

func InitFileConfig

func InitFileConfig(ConfigViper *viper.Viper)

InitFileConfig 从默认的配置文件位置读取配置

func InitFlagConfig

func InitFlagConfig(ConfigViper *viper.Viper) bool

InitFlagConfig 初始化命令行传入的参数到配置,返回值为false表示要执行创建秘钥否则为启动服务

func SetFileConfig

func SetFileConfig(ConfigViper *viper.Viper, fileName string, filePaths []string)

SetFileConfig 从指定的配置文件中读取配置

func VerifyConfig

func VerifyConfig(conf ConfigType) bool

VerifyConfig 验证config是否符合要求

Types

type ConfigType

type ConfigType struct {
	Address        string
	PrivateKeyPath string
	PublicKeyPath  string
	SignMethod     string
	Iss            string
}

ConfigType 配置类型

func Init

func Init() (ConfigType, error)

Init 根据不同的途径构造配置

Jump to

Keyboard shortcuts

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