Documentation
¶
Index ¶
Constants ¶
View Source
const (
LOCATION = "Asia/Shanghai"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CanalConfig ¶
type CanalConfig struct {
Addr string `yaml:"addr"`
User string `yaml:"user"`
Password string `yaml:"password"`
TableDB string `yaml:"tableDB"`
Tables []string `yaml:"tables"`
// contains filtered or unexported fields
}
func (*CanalConfig) SetEventHandler ¶
func (e *CanalConfig) SetEventHandler(eventHandler canal.EventHandler)
func (*CanalConfig) SetPost ¶
func (e *CanalConfig) SetPost(pos *mysql.Position)
type DatabaseConfig ¶
type DatabaseConfig struct {
Separation bool `yaml:"separation"` // 是否开启读写分离
MaxIdle int `yaml:"maxIdle"` // 最大空闲连接数
MaxOpen int `yaml:"maxOpen"` // 最大打开连接数
Master string `yaml:"master"` // 主库
Dynamic map[string]string `yaml:"dynamic"` // 动态库
Slave []string `yaml:"slave"` // 从库
Cache cache.Gorm2CacheConfig `yaml:"cache"` // 缓存配置
}
type EsConfig ¶
type RedisConfig ¶
type RedisConfig struct {
MasterName string `yaml:"masterName"` // Sentinel 哨兵模式 Master名字
Address string `yaml:"address"` // 地址 localhost:6379
Password string `yaml:"password"` // 密码
DBIds int `yaml:"dbIds"` // redisDB
MaxIdle int `yaml:"maxIdle"` // redis连接池最大空闲连接数
MaxActive int `yaml:"maxActive"` // redis连接池最大激活连接数, 0为不限制
ConnectTimeout int `yaml:"connectTimeout"` // redis连接超时时间, 单位毫秒
ReadTimeout int `yaml:"readTimeout"` // redis读取超时时间, 单位毫秒
WriteTimeout int `yaml:"writeTimeout"` // redis写入超时时间, 单位毫秒
}
type ServerConfig ¶
type ServerConfig struct {
Template *struct {
Directory string `yaml:"directory"` // 模板路径
Extension string `yaml:"extension"` // 模板后缀
} `yaml:"template"` // 模板路径
ReadTimeout time.Duration `yaml:"readTimeout"` // 读取超时
WriteTimeout time.Duration `yaml:"writeTimeout"` // 写入超时
IdleTimeout time.Duration `yaml:"idleTimeout"` // 空闲超时
ReadBufferSize int `yaml:"readBufferSize"` // 读取缓冲区大小
WriteBufferSize int `yaml:"writeBufferSize"` // 写入缓冲区大小
Prefork bool `yaml:"prefork"` // 是否启用预分叉
MaxProcs int `yaml:"maxProcs"` // 最大进程数
CaseSensitive bool `yaml:"caseSensitive"` // 是否大小写敏感
DisableKeepalive bool `yaml:"disableKeepalive"` // 是否禁用keepalive
}
type Settings ¶
type Settings struct {
Mode string `yaml:"mode"` // 运行模式
AppName string `yaml:"appName"` // 应用名称
Port int `yaml:"port"` // 端口
Version string `yaml:"version"` // 版本
EurekaConfig *EurekaConfig `yaml:"eureka"` // 服务注册
RedisConfig *RedisConfig `yaml:"redis"` // Redis配置
ServerConfig *ServerConfig `yaml:"server"` // Gin配置
DatabaseConfig *DatabaseConfig `yaml:"dataSource"` // 数据库配置
CanalConfig *CanalConfig `yaml:"canal"` // Canal配置
EsConfig *EsConfig `yaml:"es"` // ES配置
Customize map[string]interface{} `yaml:"customize"` // 自定义配置
FS *embed.FS `yaml:"-"` // embed
}
Source Files
¶
- canal.go
- config.go
- database.go
- es.go
- eureka.go
- redis.go
- server.go
Click to show internal directories.
Click to hide internal directories.