Documentation ¶
Index ¶
- Constants
- Variables
- func InitConfig()
- func NsqChannelName(id string, nameParam string) string
- func NsqDefaultChannelName(id string) string
- func NsqEphChannelName(id string, nameParam string) string
- func NsqTopicName(id string) string
- func PbMetaGet(k string, ctx context.Context) string
- type Config
- type ConfigEnv
- type Token
Constants ¶
View Source
const ( Success = "success" Failed = "failed" CommaSeparator = "," DefaultLimit = 10 )
View Source
const ( LanguageEn = "en" LanguageZh = "zh" )
View Source
const ( AppIOSDeviceType = "ios" AppAndroidDeviceType = "android" AppWebDeviceType = "web" AppWebIosDeviceType = "web_ios" AppWebAndroidDeviceType = "web_android" ClientPc = "pc" ClientMobile = "mobile" ClientPad = "pad" ClientMweb = "mweb" ClientMinapp = "minapp" InternalClientJuicy = "juicy" InternalClientXuangubao = "XGB" InternalClientSwagger = "swagger" InternalClientTubiaojia = "TBJ" InternalClientCong = "cong" InternalClientAthena = "athena" )
View Source
const ( EmailRegex = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*` //MobileRegex = `^\+1([38][0-9]|14[57]|5[^4])\d{8}$` MobileRegex = `^\+[1-9]{1}[0-9]{3,14}$` )
View Source
const ( Md_USERID = "x-userid" Md_CLIENTIP = "x-clientip" Md_DEVICETYPE = "x-devicetype" Md_OWNER = "x-owner" Md_ADMIN_USER_ROLE = "x-admin-user-role" Md_HYSTRIX_STATUS = "x-hystrix-status" Md_PLATFORM = "x-platform" Md_HYSTRIX_CLOSED = "closed" Md_HYSTRIX_OPEN = "open" Md_APPHEADER = "x-app-header" Md_Token = "x-token" Md_DEVICEID = "x-deviceid" RequestHeaderAppOffset_DEVICETYPE = 1 )
View Source
const (
TokenKey = "token_1234567890"
)
Variables ¶
View Source
var (
CanUseBalanceDeviceType = []string{AppIOSDeviceType, AppAndroidDeviceType, AppWebIosDeviceType, AppWebAndroidDeviceType}
)
View Source
var (
ContentOrderMap = map[string]string{
"display_time_desc": "article_display_time desc",
"display_time_asc": "article_display_time asc",
"updated_at_asc": "updated_at asc",
"updated_at_desc": "updated_at desc",
}
)
View Source
var TimeEnd2032 = time.Unix(1956499200, 0)
Functions ¶
func InitConfig ¶
func InitConfig()
func NsqChannelName ¶
func NsqDefaultChannelName ¶
func NsqEphChannelName ¶
func NsqTopicName ¶
Types ¶
type Config ¶
type Config struct { Environment ConfigEnv `json:"environment" yaml:"environment"` Micro std.ConfigService `json:"micro" yaml:"micro"` Log std.ConfigLog `json:"logger" yaml:"logger"` Redis std.ConfigRedis `json:"redis" yaml:"redis"` EventCollector ec.Config `json:"event_collector" yaml:"event_collector"` }
var ( GlobalConf *Config RedisClient *redis.Client )
Click to show internal directories.
Click to hide internal directories.