ezConfig

package
v0.0.0-...-77ac295 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultForwarderKey = "X-Forwarder-for"
View Source
const DefaultHttpPort = 80
View Source
const DefaultHttpsPort = 443

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConfig

type DBConfig struct {
	Driver    string `yaml:"driver"`
	DBConnect string `yaml:"DBConnect"`
}

type DBParam

type DBParam struct {
	MaxConn     int    `yaml:"max_conn"`
	MaxIdle     int    `yaml:"max_idle"`
	MaxLifetime string `yaml:"conn_max_lifetime"` //such as 1m 30s
	MaxIdletime string `yaml:"conn_max_idletime"` //such as 1m 30s
}

type HttpServiceConfig

type HttpServiceConfig struct {
	DebugMode bool                `yaml:"debug_mode"`
	Endpoint  HttpServiceEndpoint `yaml:"endpoint"`
	Http      HttpServicePlain    `yaml:"http"`
	Https     HttpServiceSecure   `yaml:"https"`
	Xff       HttpServiceXff      `yaml:"xff"`
	Cors      HttpServiceCors     `yaml:"cors"`
	Static    HttpServiceStatic   `yaml:"static"`
}

type HttpServiceCors

type HttpServiceCors struct {
	AllowHeaders     []string `yaml:"allow_headers"`
	AllowMethods     []string `yaml:"allow_methods"`
	AllowOrigin      []string `yaml:"allow_origin"`
	ExposeHeaders    []string `yaml:"expose_headers"`
	AllowCredentials bool     `yaml:"allow_credentials"`
	MaxAge           int      `yaml:"max_age"`
}

type HttpServiceEndpoint

type HttpServiceEndpoint struct {
	BaseUri  string `yaml:"base_uri"`
	Internet string `yaml:"internet"`
	Intranet string `yaml:"intranet"`
	Prefix   string `yaml:"prefix"`
}

type HttpServicePlain

type HttpServicePlain struct {
	Enable bool   `yaml:"enable"`
	Host   string `yaml:"host"`
	Port   int    `yaml:"port"`
}

type HttpServiceSecure

type HttpServiceSecure struct {
	Enable      bool   `yaml:"enable"`
	Host        string `yaml:"host"`
	Port        int    `yaml:"port"`
	TrustCaFile string `yaml:"trust_ca_file"` //CA根证书
	CertFile    string `yaml:"cert_file"`     //私钥证书
	CertPass    string `yaml:"cert_pass"`     //私钥密码
	KeyFile     string `yaml:"key_file"`      //公钥证书
}

type HttpServiceStatic

type HttpServiceStatic struct {
	StaticRoot string `yaml:"static_root"`
	LayoutRoot string `yaml:"layout_root"`
}

type HttpServiceXff

type HttpServiceXff struct {
	Enable  bool   `yaml:"enable"`
	Keyword string `yaml:"keyword"`
	Index   int    `yaml:"index"`
}

type LogConfig

type LogConfig struct {
	Level  string    `yaml:"level"`  //日志级别,debug,info,warn
	Path   string    `yaml:"path"`   //日志路径
	Rotate LogRotate `yaml:"rotate"` //日志分割时长,单位是小时,默认是1小时切一个文件
}

type LogRotate

type LogRotate struct {
	MaxSize    int  `yaml:"max_size"`    //日志文件最大尺寸(MB)
	MaxAge     int  `yaml:"max_age"`     //日志最大保留天数,0为保留所有
	MaxBackups int  `yaml:"max_backups"` //日志文件保留份数,0为保留所有
	Compress   bool `yaml:"compress"`    //日志备份文件是否压缩存储
}

Jump to

Keyboard shortcuts

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