model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

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 ApiServerConfig struct {
	ServerAddr string
	ServerName string
	ServerID   string
	ApiPort    int
}

type KafkaConsumerConfig

type KafkaConsumerConfig struct {
	Version         string   `toml:"version"`
	Topics          []string `toml:"topics"`
	GroupID         string   `toml:"group_id"`
	BrokerAddresses []string `toml:"broker_addresses"`
}

type KafkaProducerConfig

type KafkaProducerConfig struct {
	BrokerList []string
	BatchNumer int
}

type PprofConfig

type PprofConfig struct {
	PprofPort int
	Disabled  int
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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