conf

package
v0.0.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Es = EsConf{}
View Source
var HttpPort int
View Source
var LogColorful = false
View Source
var LogIndexNamePrefix = ""
View Source
var LogLevel = "DEBUG"

log conf

View Source
var LogResponseLength int
View Source
var LogShowSql = true
View Source
var MySql = MysqlConf{}
View Source
var Redis = RedisConf{}
View Source
var ServerName string

Base conf

Functions

func BaseConfig

func BaseConfig(conf Config)

Types

type Config

type Config struct {
	ServerName        string
	Env               string
	HttpPort          int
	LogLevel          string
	LogColorful       bool
	LogResponseLength int
	LogShowSql        bool

	Redis RedisConf

	Elasticsearch EsConf

	Mysql MysqlConf
}

type EsConf

type EsConf struct {
	ServerHost string
	ServerPort int
	Sniff      bool
}

ES conf

type MysqlConf

type MysqlConf struct {
	Host         string
	Port         int
	User         string
	Password     string
	NameSpace    string
	MaxIdleConns int
	MaxOpenConns int
}

Mysql conf

type RedisConf

type RedisConf struct {
	RedisHost    string
	RedisPort    int
	RedisPwd     string
	RedisDb      int
	ReadTimeout  int //取超时间 单位秒 默认值为3秒
	WriteTimeout int // 写入超时时间 单位秒 默认与读超时时间一致
	PoolSize     int //最大连接数 默认cpu数*10
	MinIdleConns int //最小空闲连接数
}

Redis conf

Jump to

Keyboard shortcuts

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