Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Redis RedisConf Etcd EtcdConf SecKill SecKillConf MysqlConfig MysqlConf TraceConfig TraceConf Zk ZookeeperConf )
View Source
var Logger log.Logger
View Source
var ZipkinTracer *zipkin.Tracer
Functions ¶
func LoadRemoteConfig ¶
func LoadRemoteConfig() (err error)
Types ¶
type AccessLimitConf ¶
type AccessLimitConf struct { IPSecAccessLimit int //IP每秒钟访问限制 UserSecAccessLimit int //用户每秒钟访问限制 IPMinAccessLimit int //IP每分钟访问限制 UserMinAccessLimit int //用户每分钟访问限制 }
访问限制
type RedisConf ¶
type RedisConf struct { RedisConn *redis.Client //链接 Proxy2layerQueueName string //队列名称 Layer2proxyQueueName string //队列名称 IdBlackListHash string //用户黑名单hash表 IpBlackListHash string //IP黑名单Hash表 IdBlackListQueue string //用户黑名单队列 IpBlackListQueue string //IP黑名单队列 Host string Password string Db int }
redis配置
type SecKillConf ¶
type SecKillConf struct { RedisConf *RedisConf EtcdConf *EtcdConf CookieSecretKey string ReferWhiteList []string //白名单 AccessLimitConf AccessLimitConf RWBlackLock sync.RWMutex WriteProxy2LayerGoroutineNum int ReadProxy2LayerGoroutineNum int IPBlackMap map[string]bool IDBlackMap map[int]bool SecProductInfoMap map[int]*SecProductInfoConf AppWriteToHandleGoroutineNum int AppReadFromHandleGoroutineNum int CoreReadRedisGoroutineNum int CoreWriteRedisGoroutineNum int CoreHandleGoroutineNum int AppWaitResultTimeout int CoreWaitResultTimeout int MaxRequestWaitTimeout int SendToWriteChanTimeout int // SendToHandleChanTimeout int // TokenPassWd string }
type SecProductInfoConf ¶
type SecProductInfoConf struct { ProductId int `json:"product_id"` //商品ID StartTime int64 `json:"start_time"` //开始时间 EndTime int64 `json:"end_time"` //结束时间 Status int `json:"status"` //状态 Total int `json:"total"` //商品总数量 Left int `json:"left"` //商品剩余数量 OnePersonBuyLimit int `json:"one_person_buy_limit"` //单个用户购买数量限制 BuyRate float64 `json:"buy_rate"` //购买频率限制 SoldMaxLimit int `json:"sold_max_limit"` // todo: error SecLimit *srv_limit.SecLimit `json:"sec_limit"` //限速控制 }
商品信息配置
type ZookeeperConf ¶
Click to show internal directories.
Click to hide internal directories.