config

package
v0.0.0-...-1a2806f Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasConfigKey

func HasConfigKey(m map[string]interface{}, key string) bool

HasConfigKey check config key,if exist return true, else return false

func InitViper

func InitViper(app string, path string, env string, config interface{}, pack bool) error

InitViper init viper with app name and config name @app server bin name @path config dir @env dev/test/prod @config struct @pack in binary bin

func InitViperDefault

func InitViperDefault(app string, path string, pack bool) error

InitViperDefault read default config

func ParseConfigValue

func ParseConfigValue(m map[string]interface{}, key string, opt interface{}, result interface{}) error

ParseConfigValue read config from map,if not exist return default value,support string,int,bool

func ReadRemoteConfig

func ReadRemoteConfig(address string, key string)

ReadRemoteConfig get remote config from etcd

Types

type IConfig

type IConfig interface {
	//GetQueueSize get module queue size
	GetQueueSize() int
}

IConfig config interface

Jump to

Keyboard shortcuts

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