Documentation
¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_READ_TIMEOUT int = 5000 DEFAULT_WRITE_TIMEOUT int = 5000 DEFAULT_HANDLE_TIMEOUT int = 5000 DEFAULT_APP_WAIT = 5000 // 默认退出等待时间 )
View Source
const ( MinuteIndex = 0 HourIndex = 1 DomIndex = 2 MonthIndex = 3 DowIndex = 4 NameIndex = 5 DescIndex = 6 )
View Source
const DEFAULT_CONF_FILE = "/data/webroot/golang/crontab.conf"
View Source
const DEFAULT_CRON_WAIT = 5000 // 默认退出等待时间
View Source
const DEFAULT_GRPC_WAIT = 5000 // 统一默认值
View Source
const MIN_FIELDS_COUNT = 6
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppConfig ¶
type AppConfig struct {
Domain string `toml:"domain"` // 域名
StaticDomain string `toml:"static_domain"` //静态文件域名
Addr string `toml:"listen"` // 监听地址
ReadTimeout int `toml:"readTimeout"` // 请求读超时
HandleTimeout int `toml:"handleTimeout"` // 请求处理超时
WriteTimeout int `toml:"writeTimeout"` // 请求写超时
WaitGraceExit int `toml:"waitGraceExit"` // 优雅退出等待时间
// token配置
TokenHeaderKey string `toml:"token_header_key"`
TokenHeaderAdminKey string `toml:"token_header_admin_key"`
TokenAccessSecret string `toml:"token_access_secret"` // token访问密钥
TokenAccessExpire int64 `toml:"token_access_expire"` // token过期时间
}
APP配置
type CronConfig ¶
type CronConfig struct {
Domain string `toml:"domain"` // 域名
WaitGraceExit int `toml:"waitGraceExit"`
Content string `toml:"content"`
ConfFile string `toml:"confFile"`
}
Cron配置
type GEConfig ¶
type GEConfig struct {
Mode MODE // 模式 app, cron
Domain string `toml:"domain"` // 域名
Debug int `toml:"debug"` // 调试模式
EnableCors bool `toml:"enable_cors"` //是否启用跨域
Pprof int `toml:"pprof"` // 性能采样功能
Prometheus int `toml:"prometheus"` // 普罗米修斯采集
AppConfig *AppConfig `toml:"App"` // App配置
GrpcConfig *GrpcConfig `toml:"Grpc"` // zgrpc-server配置
CronConfig *CronConfig `toml:"Cron"` // Cron配置
TransConf *TransConf `toml:"TransConf"` //翻译配置:百度
Redis *gredis.CACHEConf `toml:"Redis"` //redis配置
Mysql *gmysql.DBConf `toml:"Mysql"` // mysql配置
Pgsql *gpgsql.DBConf `toml:"Pgsql"` // pgsql配置
HttpClientConfig *ghttp.HttpConfig `toml:"HttpClient"` //http-client配置
ModuleName string `toml:"module_name"`
CurrentIp string
}
var (
GEConf *GEConfig
)
type GrpcConfig ¶
type GrpcConfig struct {
Domain string `toml:"domain"` // 域名
Addr string `toml:"listen"` // 监听地址
ReadTimeout int `toml:"readTimeout"` // 请求读超时
HandleTimeout int `toml:"handleTimeout"` // 请求处理超时
WriteTimeout int `toml:"writeTimeout"` // 请求写超时
WaitGraceExit int `toml:"waitGraceExit"` // 优雅退出等待时间
}
zgrpc-server配置
Click to show internal directories.
Click to hide internal directories.