conf

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfMap sync.Map

Functions

func GetEnvironment

func GetEnvironment(envName string) (envValue string)

GetEnvironment get the system environment by name. GetEnvironment 获取系统环境变量 parameters envName return envValue

func GetLocalIPAddr

func GetLocalIPAddr() string

GetLocalIPAddr get the local IP address GetLocalIPAddr 获取本地IP return IP address

func GetPid

func GetPid() (pid int)

GetPid get the proccess id GetPid 获取进程ID return pid

func Getwd

func Getwd() (getwd string, err error)

Getwd get the current working directory Getwd 获取当前工作目录 return getwd

func SetEnv

func SetEnv(key string, value string) error

func UnSetEnv

func UnSetEnv(key string) error

Types

type Config

type Config struct {
	Env     string      `yaml:"env" json:"env"`
	Version string      `yaml:"version" json:"version"`
	Redis   []RedisStru `yaml:"redis" json:"redis"`
	MySQL   []MySQLStru `yaml:"mysql" json:"mysql"`
}

func LoadConfig

func LoadConfig() *Config

type MySQLStru

type MySQLStru struct {
	Name     string `yaml:"name" json:"name"`
	Host     string `yaml:"host" json:"host"`
	Username string `yaml:"user" json:"user"`
	Password string `yaml:"password" json:"password"`
	Charset  string `yaml:"charset" json:"charset"`
	Owner    string `yaml:"owner" json:"owner"`
}

type RedisStru

type RedisStru struct {
	Name  string `yaml:"name" json:"name"`
	Host  string `yaml:"host" json:"host"`
	Auth  string `yaml:"auth" json:"auth"`
	Owner string `yaml:"owner" json:"owner"`
}

Jump to

Keyboard shortcuts

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