Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTextRisk(text string, token string) bool
- func DecryptWeChatData(encryptedData, iv, appId, sessionKey string) (map[string]interface{}, error)
- func FilterEmoji(content string) string
- func GetRandInt(n int) int
- func GetRandIntRange(lower int, upper int) int
- func GetRolesMap() map[string]string
- func NsqChannelName(id string, nameParam string) string
- func PKCS7UnPadding(plantText []byte) []byte
- func PbGetPlatform(ctx context.Context) string
- func PbGetUser(ctx context.Context) int64
- func PbMetaGet(k string, ctx context.Context) string
- func Struct2Map(obj interface{}) map[string]interface{}
- func SysTokenToString(o *Token) string
- func TokenToString(o *Token) string
- type AccessToken
- type CheckRsp
- type QRCode
- type Token
Constants ¶
View Source
const ( Success = "success" Failed = "failed" CommaSeparator = "," DefaultLimit = 10 )
View Source
const ( WeiChat_AppId = "wx_appid" WeiChat_AppSecret = "wx_appsecret" )
View Source
const ( LanguageEn = "en" LanguageZh = "zh" )
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 ( 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 ( 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_WEBUSREID = "x-webuserid" Md_APPTYPE = "x-apptype" Md_INSTID = "x-instid" Md_OPENID = "x-openid" Md_SESSIONKEY = "x-sessionkey" RequestHeaderAppOffset_DEVICETYPE = 1 )
View Source
const ( SkipChartQueries uint32 = 1 SkipChartStyle uint32 = (1 << 1) SkipChartSettings uint32 = (1 << 2) SkipChartQueryRecord uint32 = (1 << 3) )
View Source
const ( TokenKey = "tushuangshuang2501hahaha" SysTokenKey = "tushuangshuang20190815st" )
View Source
const ( Internal = "internal" Mobile = "mobile" Email = "email" Wechat = "wechat" Weibo = "weibo" Tencent = "tencent" Huawei = "huawei" System = "system" )
app_type
View Source
const ( InternalTokenOutTime = 7 * 24 * 3600 UserTokenOutTime = 10 * 365 * 3600 * 24 )
View Source
const (
Permanent_Expiration = 1999999999
)
View Source
const SolarPlatform = "solar-platform"
View Source
const (
StatusFrozen = "frozen"
)
View Source
const (
UserLikeSearch = "like"
)
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",
}
)
Functions ¶
func CheckTextRisk ¶
func DecryptWeChatData ¶
func FilterEmoji ¶
func GetRandInt ¶
func GetRandIntRange ¶
func GetRolesMap ¶
func NsqChannelName ¶
func PKCS7UnPadding ¶
func PbGetPlatform ¶
func Struct2Map ¶
func Struct2Map(obj interface{}) map[string]interface{}
func SysTokenToString ¶
func TokenToString ¶
Types ¶
type AccessToken ¶
type AccessToken struct { AccessToken string `json:"access_token"` ExpiresIn time.Duration `json:"expires_in"` }
func GetAccessToken ¶
func GetAccessToken() *AccessToken
Click to show internal directories.
Click to hide internal directories.