conf

package
v0.0.0-...-269099d Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
View Source
const ConfigFileName = "config.yaml"
View Source
const DefaultPort = "1231"
View Source
const ServiceName = "pocassist"
View Source
const Version = "1.0.4"
View Source
const Website = "https://pocassist.jweny.top/"

Variables

This section is empty.

Functions

func ArrayToString

func ArrayToString(array []string) string

func ReadYamlConfig

func ReadYamlConfig(configFile string)

func Setup

func Setup()

加载配置

func StrInArray

func StrInArray(str string, array []string) error

func VerifyConfig

func VerifyConfig() error

func WriteYamlConfig

func WriteYamlConfig(configFile string)

Types

type Config

type Config struct {
	HttpConfig    HttpConfig    `mapstructure:"httpConfig"`
	DbConfig      DbConfig      `mapstructure:"dbConfig"`
	PluginsConfig PluginsConfig `mapstructure:"pluginsConfig"`
	Reverse       Reverse       `mapstructure:"reverse"`
	ServerConfig  ServerConfig  `mapstructure:"serverConfig"`
	LogConfig     LogConfig     `mapstructure:"logConfig"`
}
var GlobalConfig *Config

func (*Config) DebugOutput

func (cfg *Config) DebugOutput() string

func (*Config) ErrorOutput

func (cfg *Config) ErrorOutput() string

func (*Config) InfoOutput

func (cfg *Config) InfoOutput() string

func (*Config) Level

func (cfg *Config) Level() zapcore.Level

func (*Config) LogPath

func (cfg *Config) LogPath() string

func (*Config) MaxLogSize

func (cfg *Config) MaxLogSize() int

func (*Config) ServiceName

func (cfg *Config) ServiceName() string

type DbConfig

type DbConfig struct {
	EnableDefault bool   `mapstructure:"enableDefault"`
	Sqlite        string `mapstructure:"sqlite"`
	Mysql         Mysql  `mapstructure:"mysql"`
}

type Headers

type Headers struct {
	UserAgent string `mapstructure:"user_agent"`
}

type HttpConfig

type HttpConfig struct {
	Headers     Headers `mapstructure:"headers"`
	Proxy       string  `mapstructure:"proxy"`
	HttpTimeout int     `mapstructure:"http_timeout"`
	DailTimeout int     `mapstructure:"dail_timeout"`
	UdpTimeout  int     `mapstructure:"udp_timeout"`
	MaxQps      int     `mapstructure:"max_qps"`
	MaxRedirect int     `mapstructure:"max_redirect"`
}

type LogConfig

type LogConfig struct {
	MaxSize    int  `mapstructure:"max_size"`
	MaxBackups int  `mapstructure:"max_backups"`
	MaxAge     int  `mapstructure:"max_age"`
	Compress   bool `mapstructure:"compress"`
}

type Mysql

type Mysql struct {
	Host     string `mapstructure:"host"`
	Password string `mapstructure:"password"`
	Port     string `mapstructure:"port"`
	User     string `mapstructure:"user"`
	Database string `mapstructure:"database"`
	Timeout  string `mapstructure:"timeout"`
}

type PluginsConfig

type PluginsConfig struct {
	Parallel   int `mapstructure:"parallel"`
	Concurrent int `mapstructure:"concurrent"`
}

type Reverse

type Reverse struct {
	ApiKey string `mapstructure:"api_key"`
	Domain string `mapstructure:"domain"`
}

type ServerConfig

type ServerConfig struct {
	JwtSecret string `mapstructure:"jwt_secret"`
	RunMode   string `mapstructure:"run_mode"`
}

Jump to

Keyboard shortcuts

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