Documentation
¶
Index ¶
- func Init(configFile string, fs ...func()) error
- func Set(conf *Config)
- func Show(hiddenFields ...string) string
- type App
- type Args
- type Center
- type ClientSecure
- type ClientToken
- type Config
- type ConsumerOption
- type Database
- type DeadQueueBindOption
- type DeadQueueDeclareOption
- type DoingOrder
- type Elasticsearch
- type Etcd
- type ExchangeDeclareOptions
- type Grpc
- type GrpcClient
- type HTTP
- type IgnoreMethods
- type Jaeger
- type Jwt
- type LogFileConfig
- type Logger
- type Mysql
- type Nacos
- type NormalQueueDeclareOption
- type Pool
- type Rabbitmq
- type Redis
- type Rules
- type Sentinel
- type ServerSecure
- type Sign
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
CacheType string `yaml:"cacheType" json:"cacheType"`
EnableCircuitBreaker bool `yaml:"enableCircuitBreaker" json:"enableCircuitBreaker"`
EnableHTTPProfile bool `yaml:"enableHTTPProfile" json:"enableHTTPProfile"`
EnableLimit bool `yaml:"enableLimit" json:"enableLimit"`
EnableMetrics bool `yaml:"enableMetrics" json:"enableMetrics"`
EnableStat bool `yaml:"enableStat" json:"enableStat"`
EnableTrace bool `yaml:"enableTrace" json:"enableTrace"`
Env string `yaml:"env" json:"env"`
Host string `yaml:"host" json:"host"`
MachineID int `yaml:"machineId" json:"machineId"`
Name string `yaml:"name" json:"name"`
OpenCron bool `yaml:"openCron" json:"openCron"`
OpenHTTP bool `yaml:"openHttp" json:"openHttp"`
OpenJwt bool `yaml:"openJwt" json:"openJwt"`
OpenSign bool `yaml:"openSign" json:"openSign"`
OpenXSS bool `yaml:"openXSS" json:"openXSS"`
RegistryDiscoveryType string `yaml:"registryDiscoveryType" json:"registryDiscoveryType"`
TracingSamplingRate float64 `yaml:"tracingSamplingRate" json:"tracingSamplingRate"`
Version string `yaml:"version" json:"version"`
}
type Args ¶ added in v1.3.23
type Args struct {
XMessageTTL int `yaml:"xMessageTtl" json:"xMessageTtl"`
}
type ClientSecure ¶
type ClientToken ¶
type Config ¶
type Config struct {
App App `yaml:"app" json:"app"`
Database Database `yaml:"database" json:"database"`
Elasticsearch Elasticsearch `yaml:"elasticsearch" json:"elasticsearch"`
Etcd Etcd `yaml:"etcd" json:"etcd"`
Grpc Grpc `yaml:"grpc" json:"grpc"`
GrpcClient []GrpcClient `yaml:"grpcClient" json:"grpcClient"`
HTTP HTTP `yaml:"http" json:"http"`
Jaeger Jaeger `yaml:"jaeger" json:"jaeger"`
Jwt Jwt `yaml:"jwt" json:"jwt"`
Logger Logger `yaml:"logger" json:"logger"`
Rabbitmq Rabbitmq `yaml:"rabbitmq" json:"rabbitmq"`
Redis Redis `yaml:"redis" json:"redis"`
Sentinel Sentinel `yaml:"sentinel" json:"sentinel"`
Sign Sign `yaml:"sign" json:"sign"`
}
type ConsumerOption ¶ added in v1.3.23
type ConsumerOption struct {
Consumer string `yaml:"consumer" json:"consumer"`
Exclusive bool `yaml:"exclusive" json:"exclusive"`
Global bool `yaml:"global" json:"global"`
IsAutoAck bool `yaml:"isAutoAck" json:"isAutoAck"`
MsgDurable bool `yaml:"msgDurable" json:"msgDurable"`
NoLocal bool `yaml:"noLocal" json:"noLocal"`
NoWait bool `yaml:"noWait" json:"noWait"`
PrefetchCount int `yaml:"prefetchCount" json:"prefetchCount"`
PrefetchSize int `yaml:"prefetchSize" json:"prefetchSize"`
}
type DeadQueueBindOption ¶ added in v1.3.23
type DeadQueueBindOption struct {
NoWait bool `yaml:"noWait" json:"noWait"`
}
type DeadQueueDeclareOption ¶ added in v1.3.23
type DoingOrder ¶ added in v1.3.24
type DoingOrder struct {
ConsumerNum int `yaml:"consumerNum" json:"consumerNum"`
ConsumerOption ConsumerOption `yaml:"consumerOption" json:"consumerOption"`
DeadKey string `yaml:"deadKey" json:"deadKey"`
DeadQueueBindOption DeadQueueBindOption `yaml:"deadQueueBindOption" json:"deadQueueBindOption"`
DeadQueueDeclareOption DeadQueueDeclareOption `yaml:"deadQueueDeclareOption" json:"deadQueueDeclareOption"`
DeadQueueName string `yaml:"deadQueueName" json:"deadQueueName"`
Enable bool `yaml:"enable" json:"enable"`
ExchangeDeclareOptions ExchangeDeclareOptions `yaml:"exchangeDeclareOptions" json:"exchangeDeclareOptions"`
ExchangeName string `yaml:"exchangeName" json:"exchangeName"`
NormalKey string `yaml:"normalKey" json:"normalKey"`
NormalQueueBindOption DeadQueueBindOption `yaml:"normalQueueBindOption" json:"normalQueueBindOption"`
NormalQueueDeclareOption NormalQueueDeclareOption `yaml:"normalQueueDeclareOption" json:"normalQueueDeclareOption"`
NormalQueueName string `yaml:"normalQueueName" json:"normalQueueName"`
QueueType string `yaml:"queueType" json:"queueType"`
}
type Elasticsearch ¶ added in v1.3.12
type Elasticsearch struct {
Addresses []string `yaml:"addresses" json:"addresses"`
APIKey string `yaml:"apiKey" json:"apiKey"`
ConnectionKeepAlive int `yaml:"connectionKeepAlive" json:"connectionKeepAlive"`
ConnectionTimeout int `yaml:"connectionTimeout" json:"connectionTimeout"`
EnableHealthCheck bool `yaml:"enableHealthCheck" json:"enableHealthCheck"`
EnablePingCheck bool `yaml:"enablePingCheck" json:"enablePingCheck"`
ExpectContinueTimeout int `yaml:"expectContinueTimeout" json:"expectContinueTimeout"`
IdleConnTimeout int `yaml:"idleConnTimeout" json:"idleConnTimeout"`
IsOpen bool `yaml:"isOpen" json:"isOpen"`
MaxConnsPerHost int `yaml:"maxConnsPerHost" json:"maxConnsPerHost"`
MaxIdleConns int `yaml:"maxIdleConns" json:"maxIdleConns"`
MaxIdleConnsPerHost int `yaml:"maxIdleConnsPerHost" json:"maxIdleConnsPerHost"`
MaxRetries int `yaml:"maxRetries" json:"maxRetries"`
Password string `yaml:"password" json:"password"`
ResponseHeaderTimeout int `yaml:"responseHeaderTimeout" json:"responseHeaderTimeout"`
RetryBackoff int `yaml:"retryBackoff" json:"retryBackoff"`
RetryOnStatus []int `yaml:"retryOnStatus" json:"retryOnStatus"`
Timeout int `yaml:"timeout" json:"timeout"`
TLSHandshakeTimeout int `yaml:"tlsHandshakeTimeout" json:"tlsHandshakeTimeout"`
Username string `yaml:"username" json:"username"`
}
type ExchangeDeclareOptions ¶ added in v1.3.23
type Grpc ¶
type Grpc struct {
EnableToken bool `yaml:"enableToken" json:"enableToken"`
HTTPPort int `yaml:"httpPort" json:"httpPort"`
Port int `yaml:"port" json:"port"`
ServerSecure ServerSecure `yaml:"serverSecure" json:"serverSecure"`
}
type GrpcClient ¶
type GrpcClient struct {
ClientSecure ClientSecure `yaml:"clientSecure" json:"clientSecure"`
ClientToken ClientToken `yaml:"clientToken" json:"clientToken"`
EnableLoadBalance bool `yaml:"enableLoadBalance" json:"enableLoadBalance"`
Host string `yaml:"host" json:"host"`
Name string `yaml:"name" json:"name"`
Port int `yaml:"port" json:"port"`
RegistryDiscoveryType string `yaml:"registryDiscoveryType" json:"registryDiscoveryType"`
Timeout int `yaml:"timeout" json:"timeout"`
}
type IgnoreMethods ¶ added in v1.1.67
type Jwt ¶ added in v1.0.2
type Jwt struct {
Expire int `yaml:"expire" json:"expire"`
IgnoreMethods IgnoreMethods `yaml:"ignoreMethods" json:"ignoreMethods"`
Issuer string `yaml:"issuer" json:"issuer"`
SigningKey string `yaml:"signingKey" json:"signingKey"`
SigningMethod string `yaml:"signingMethod" json:"signingMethod"`
}
type LogFileConfig ¶ added in v1.0.2
type LogFileConfig struct {
Filename string `yaml:"filename" json:"filename"`
IsCompression bool `yaml:"isCompression" json:"isCompression"`
IsNoPrint bool `yaml:"isNoPrint" json:"isNoPrint"`
IsSaveDay bool `yaml:"isSaveDay" json:"isSaveDay"`
MaxAge int `yaml:"maxAge" json:"maxAge"`
MaxBackups int `yaml:"maxBackups" json:"maxBackups"`
MaxSize int `yaml:"maxSize" json:"maxSize"`
}
type Logger ¶
type Logger struct {
AsyncBufferSize int `yaml:"asyncBufferSize" json:"asyncBufferSize"`
AsyncFlushInterval int `yaml:"asyncFlushInterval" json:"asyncFlushInterval"`
Format string `yaml:"format" json:"format"`
IsAsync bool `yaml:"isAsync" json:"isAsync"`
IsSave bool `yaml:"isSave" json:"isSave"`
Level string `yaml:"level" json:"level"`
LogFileConfig LogFileConfig `yaml:"logFileConfig" json:"logFileConfig"`
MaxLen int `yaml:"maxLen" json:"maxLen"`
}
type Mysql ¶
type Mysql struct {
ConnMaxLifetime int `yaml:"connMaxLifetime" json:"connMaxLifetime"`
Dsn string `yaml:"dsn" json:"dsn"`
EnableLog bool `yaml:"enableLog" json:"enableLog"`
MastersDsn []string `yaml:"mastersDsn" json:"mastersDsn"`
MaxIdleConns int `yaml:"maxIdleConns" json:"maxIdleConns"`
MaxIdleTime int `yaml:"maxIdleTime" json:"maxIdleTime"`
MaxOpenConns int `yaml:"maxOpenConns" json:"maxOpenConns"`
SlavesDsn []string `yaml:"slavesDsn" json:"slavesDsn"`
SlowQueryThresholdMs int `yaml:"slowQueryThresholdMs" json:"slowQueryThresholdMs"`
}
type Nacos ¶
type Nacos struct {
ContextPath string `yaml:"contextPath" json:"contextPath"`
DataID string `yaml:"dataID" json:"dataID"`
Format string `yaml:"format" json:"format"`
Group string `yaml:"group" json:"group"`
IPAddr string `yaml:"ipAddr" json:"ipAddr"`
NamespaceID string `yaml:"namespaceID" json:"namespaceID"`
Port int `yaml:"port" json:"port"`
Scheme string `yaml:"scheme" json:"scheme"`
}
type NormalQueueDeclareOption ¶ added in v1.3.23
type Pool ¶ added in v1.3.23
type Pool struct {
AntsCap int `yaml:"antsCap" json:"antsCap"`
DialTimeout int `yaml:"dialTimeout" json:"dialTimeout"`
HealthCheckPeriod int `yaml:"healthCheckPeriod" json:"healthCheckPeriod"`
Heartbeat int `yaml:"heartbeat" json:"heartbeat"`
InitialCap int `yaml:"initialCap" json:"initialCap"`
MaxCap int `yaml:"maxCap" json:"maxCap"`
MaxIdle int `yaml:"maxIdle" json:"maxIdle"`
ReconnectTime int `yaml:"reconnectTime" json:"reconnectTime"`
StatsLogOpen bool `yaml:"statsLogOpen" json:"statsLogOpen"`
URL string `yaml:"url" json:"url"`
}
type Rabbitmq ¶ added in v1.3.23
type Rabbitmq struct {
DoingOrder DoingOrder `yaml:"DoingOrder" json:"DoingOrder"`
Enable bool `yaml:"enable" json:"enable"`
Pool Pool `yaml:"pool" json:"pool"`
}
type Redis ¶
type Redis struct {
DialTimeout int `yaml:"dialTimeout" json:"dialTimeout"`
Dsn string `yaml:"dsn" json:"dsn"`
IdleTimeout int `yaml:"idleTimeout" json:"idleTimeout"`
MaxConnAge int `yaml:"maxConnAge" json:"maxConnAge"`
MinIdleConns int `yaml:"minIdleConns" json:"minIdleConns"`
PoolSize int `yaml:"poolSize" json:"poolSize"`
PoolTimeout int `yaml:"poolTimeout" json:"poolTimeout"`
ReadTimeout int `yaml:"readTimeout" json:"readTimeout"`
WriteTimeout int `yaml:"writeTimeout" json:"writeTimeout"`
}
type ServerSecure ¶
type Sign ¶ added in v1.0.2
type Sign struct {
IgnoreUrls IgnoreMethods `yaml:"ignoreUrls" json:"ignoreUrls"`
SignExpiredTime int `yaml:"signExpiredTime" json:"signExpiredTime"`
SignKey string `yaml:"signKey" json:"signKey"`
}
Click to show internal directories.
Click to hide internal directories.