Documentation ¶
Index ¶
Constants ¶
View Source
const ( TAG_BIZ = "Biz" // 处理本节点biz TAG_EXTERNAL_FOO = "ExternalFoo" // 非跨分组 TAG_EXTERNAL_BAR = "ExternalBar" // 跨分组 )
View Source
const ( EntryTimeInterval int64 = 5 // 入场时间间隔 s PingTimeInterval int64 = 100 // 心跳时间间隔 s OnlineInfoStatisticInterval int = 8 // 在线信息统计时间间隔 s )
View Source
const ( // flag ConfigName = "spring.cloud.config.name" ConfigFullName = "spring.cloud.config.full.name" ConfigLabel = "spring.cloud.config.label" ConfigProfile = "spring.cloud.config.profile" ConfigUri = "spring.cloud.config.uri" ConfigServiceAddr = "service_addr" ConfigKafkaGroupUri = "kafka_group_uri" ConfigPprofPort = "pprof.port" ConfigPprofDisabled = "pprof.disabled" ConfigDebugLogEnabled = "logging.debug.enabled" EnableDebug = "enableDebug" ApplicationName = "spring.application.name" ProfilesActive = "spring.profiles.active" // log LoggingLevel = "logging.level.root" LoggingMaxSize = "logging.max-size" LoggingMaxBackups = "logging.max-backups" LoggingMaxAge = "logging.max-age" // websocket server WebsocketServerHost = "websocket.server.host" WebsocketServerPort = "websocket.netty.port" WebsocketEncryptKey = "websocket.encryptKey" WebsocketSignatureSecretKey = "websocket.signatureSecretKey" // api server ApiServerPort = "server.port" // consul ConsulHost = "spring.cloud.consul.host" ConsulPort = "spring.cloud.consul.port" // kafka KafkaVersion = "kafka.version" KafkaGroupID = "kafka.groupId" KafkaGroupIDForAcross = "kafka.groupIdForAcross" KafkaServer = "kafka.server" KafkaServerForAcross = "kafka.serverForAcross" // redis RedisDatabase = "spring.redis.database" RedisHost = "spring.redis.host" RedisPort = "spring.redis.port" RedisPassword = "spring.redis.password" RedisActive = "spring.redis.active" RedisIdle = "spring.redis.idle" RedisDialTimeout = "spring.redis.dialTimeout" RedisReadTimeout = "spring.redis.readTimeout" RedisWriteTimeout = "spring.redis.writeTimeout" RedisIdleTimeout = "spring.redis.idleTimeout" // mongo MongoDBURL = "spring.data.mongodb.uri" MongoDBDatabase = "spring.data.mongodb.database" // mysql DatasourceDsn = "spring.datasource.dsn" DatasourceIdleSize = "spring.datasource.idleSize" DatasourceMaxSize = "spring.datasource.maxSize" DatasourceMaxLifeTime = "spring.datasource.maxLifeTime" DatasourceSqlDebug = "spring.datasource.sqlDebug" )
View Source
const (
GroupIDForWsBiz = "ForWsBiz"
)
View Source
const (
MongoDBNameDB1 = "db1"
)
View Source
const (
OnlineUserKey = "live:onlineAudience:"
)
redis key
View Source
const (
RedisDBNameDB1 = "db1"
)
Variables ¶
View Source
var ( ConfigNameValue *string = nil ConfigFullNameValue *string = nil ConfigLabelValue *string = nil ConfigProfileValue *string = nil ConfigUriValue *string = nil ConfigServiceAddrValue *string = nil ConfigPprofPortValue *string = nil ConfigPprofDisabledValue *string = nil ConfigDebugLogEnabledValue *string = nil ConfigKafkaGroupUriValue *string = nil )
Functions ¶
func ServerConfigInit ¶
func ServerConfigInit()
Types ¶
type ApiServerConfig ¶
type KafkaConsumerConfig ¶
type KafkaProducerConfig ¶
type PprofConfig ¶
type ServerConfig ¶
type ServerConfig struct { DebugMode int ConsulAddr string ServerID string WebsocketPort int Des3Key4WsMsg string SignatureSecretKey string EntryTimeInterval int64 PingTimeInterval int64 OnlineInfoStatisticInterval int PprofConf PprofConfig ApiServerConf ApiServerConfig ProducerConf KafkaProducerConfig ConsumerConf map[string]KafkaConsumerConfig RedisConf []redisclient.RedisClientConfig MongoConf []mongoclient.MongoClientConfig MysqlConf []mysqlclient.MysqlClientConfig LogConf logger.TLogConfig }
func GetServerConfig ¶
func GetServerConfig() *ServerConfig
Click to show internal directories.
Click to hide internal directories.