config

package
v0.0.0-...-18a434d Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(configPath string) (err error)

Types

type Config

type Config struct {
	Server *ServerConfig `mapstructure:"server"`
	Prefix *PrefixConfig `mapstructure:"prefix"`
	Mysql  *MysqlConfig  `mapstructure:"mysql"`
}
var Conf *Config

func (*Config) AesDecode

func (c *Config) AesDecode() error

type MysqlConfig

type MysqlConfig struct {
	Host        string `mapstructure:"host"`
	Port        string `mapstructure:"port"`
	SlaveHost   string `mapstructure:"slaveHost"`
	SlavePort   string `mapstructure:"slavePort"`
	User        string `mapstructure:"user"`
	Password    string `mapstructure:"password"`
	Database    string `mapstructure:"database"`
	MaxIdleConn int    `mapstructure:"maxIdleConn"`
	MaxOpenConn int    `mapstructure:"maxOpenConn"`
}

type PrefixConfig

type PrefixConfig struct {
	Api string `mapstructure:"api"`
}

type ServerConfig

type ServerConfig struct {
	Port           int            `mapstructure:"port"`
	Mode           string         `mapstructure:"mode"`
	ClientIDKey    string         `mapstructure:"clientIDKey"`
	StaticResource StaticResource `mapstructure:"static_resource"`
}

type StaticResource

type StaticResource struct {
	Enable       bool   `mapstructure:"enable"`
	RelativePath string `mapstructure:"relative_path"`
	RootPath     string `mapstructure:"root_path"`
}

Jump to

Keyboard shortcuts

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