config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfiguration

func InitConfiguration(configFile string) error

Types

type Config

type Config struct {
	AppName            string
	Address            string
	Port               string
	DbusPort           string       `mapstructure:"dbus_port"`
	AsyncProcess       bool         `mapstructure:"async_process"`
	MissionRetryNumber int          `mapstructure:"mission_retry_number"`
	DatabaseDriver     string       `mapstructure:"database_driver"`
	MySQL              MySQLConfig  //需要定义子类型对应的变量,如果不定义映射不成功
	SQLite             SQLiteConfig //需要定义子类型对应的变量,如果不定义映射不成功
	HA                 ha
}

Config对象和config.toml文件保持一致

var CONFIG *Config

type MySQLConfig added in v0.0.3

type MySQLConfig struct {
	Ip                string //公有访问
	Port              string
	User              string
	Password          string
	Database          string
	MaxIdleConnection int `mapstructure:"max_idle_connection"`
	MaxOpenConnection int `mapstructure:"max_open_connection"`
}

func (*MySQLConfig) IsEmpty added in v0.0.3

func (this *MySQLConfig) IsEmpty() bool

type SQLiteConfig added in v0.0.3

type SQLiteConfig struct {
	File              string
	Database          string
	MaxIdleConnection int `mapstructure:"max_idle_connection"`
	MaxOpenConnection int `mapstructure:"max_open_connection"`
}

func (*SQLiteConfig) IsEmpty added in v0.0.3

func (this *SQLiteConfig) IsEmpty() bool

Jump to

Keyboard shortcuts

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