config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SrunConf   = "/srun3/etc/srun.conf"
	SystemConf = "/srun3/etc/system.conf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SrunConfig
	SystemConfig
}

func GetConfig

func GetConfig(path, mode string) (*Config, error)

GetConfig 获取配置

func (*Config) ReadSrun

func (c *Config) ReadSrun(filePath string) error

func (*Config) ReadSystem

func (c *Config) ReadSystem(filePath string) error

type Reader

type Reader interface {
	ReadSrun(filePath string) error
	ReadSystem(filePath string) error
}

type SrunConfig

type SrunConfig struct {
	Username            string `ini:"username"`
	Hostname            string `ini:"hostname"`
	Dbname              string `ini:"dbname"`
	Password            string `ini:"password"`
	Port                string `ini:"port"`
	DetailUsername      string `ini:"detail_username"`
	DetailHostname      string `ini:"detail_hostname"`
	DetailDbname        string `ini:"detail_dbname"`
	DetailPassword      string `ini:"detail_password"`
	DetailPort          string `ini:"detail_port"`
	LogUsername         string `ini:"log_username"`
	LogHostname         string `ini:"log_hostname"`
	LogDbname           string `ini:"log_dbname"`
	LogPassword         string `ini:"log_password"`
	LogPort             string `ini:"log_port"`
	StatisticsHostname  string `ini:"statistics_hostname"`
	StatisticsUsername  string `ini:"statistics_username"`
	StatisticsDbname    string `ini:"statistics_dbname"`
	StatisticsPassword  string `ini:"statistics_password"`
	StatisticsTcpPort   string `ini:"statistics_tcp_port"`
	StatisticsHttpPort  string `ini:"statistics_http_port"`
	StatisticsMysqlPort string `ini:"statistics_mysql_port"`
	InterfaceIp         string `ini:"interface_ip"`
}

type SystemConfig

type SystemConfig struct {
	OnlineServer  string `ini:"online_server"`
	UserServer    string `ini:"user_server"`
	AuthServer    string `ini:"auth_server"`
	DetailServer  string `ini:"detail_server"`
	LogServer     string `ini:"log_server"`
	DyeServer     string `ini:"dye_server"`
	MyIp          string `ini:"my_ip"`
	RemoteDmIp    string `ini:"remote_dm_ip"`
	ThreadNum     string `ini:"thread_num"`
	RedisPassword string `ini:"redis_password"`
	CacheServer   string `ini:"cache_server"`
}

Jump to

Keyboard shortcuts

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