conf

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvConfigPath = "IPS_CONFIG_PATH"
	ConfigDirName = "ips"
	ConfigName    = "config"
	ConfigType    = "json"
)

Variables

View Source
var ConfigPath string

Functions

func GetConfig added in v0.1.4

func GetConfig() map[string]interface{}

GetConfig 获取配置

func GetIPv4File added in v0.1.4

func GetIPv4File() string

GetIPv4File 获取 IPv4 文件路径

func GetIPv6File added in v0.1.4

func GetIPv6File() string

GetIPv6File 获取 IPv6 文件路径

func PrepareDir

func PrepareDir(path string)

PrepareDir 初始化目录

func SetConfig added in v0.1.4

func SetConfig(key string, value interface{}) error

SetConfig 设置配置

Types

type Config

type Config struct {
	IPv4Format string `mapstructure:"ipv4_format"`
	IPv4File   string `mapstructure:"ipv4_file"`
	IPv6Format string `mapstructure:"ipv6_format"`
	IPv6File   string `mapstructure:"ipv6_file"`
	Fields     string `mapstructure:"fields"`
}
var Conf Config

Jump to

Keyboard shortcuts

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