Documentation
¶
Index ¶
- Variables
- func Decrypt(crypted []byte, key []byte) ([]byte, error)
- func Encrypt(origData []byte, key []byte) ([]byte, error)
- func Hash2TsSeconds(timeHash string) (ts int64, err error)
- func IntStr2Md5(intStr string) (res []byte)
- func IsMail(mail string) bool
- func IsTel(tel string) bool
- func MD52IntStr(md5d []byte) (res string)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func TsSeconds2Hash(tsSecond int64) string
- type Service
- func (s *Service) AddCookie(c context.Context, mid int64) (res *model.CookieProto, err error)
- func (s *Service) AddOldCookie(c context.Context, mid int64) (res *model.CookieProto, err error)
- func (s *Service) AddToken(c context.Context, appID, mid int64) (res *model.RefreshTokenResp, err error)
- func (s *Service) CheckUser(c context.Context, username, pwd string) (decodeUser *model.DecodeUser, err error)
- func (s *Service) Close()
- func (s *Service) CookieInfo(c context.Context, sessionData string) (cookie *model.CookieProto, err error)
- func (s *Service) DelCookie(c context.Context, session string, mid int64) (err error)
- func (s *Service) DelCookieByMid(c context.Context, mid int64) (err error)
- func (s *Service) DelToken(c context.Context, token, refresh string) (err error)
- func (s *Service) DelTokenByMid(c context.Context, mid int64) (err error)
- func (s *Service) Ping(c context.Context) (err error)
- func (s *Service) ProxyAddCookie(c context.Context, mid int64) (res *model.CookieProto, err error)
- func (s *Service) ProxyAddToken(c context.Context, appID, mid int64) (res *model.RefreshTokenResp, err error)
- func (s *Service) ProxyCheckUser(c context.Context, param *model.ParamLogin) (decodeUser *model.DecodeUser, err error)
- func (s *Service) ProxyDeleteCookie(c context.Context, mid int64, session string) (err error)
- func (s *Service) ProxyDeleteCookies(c context.Context, mid int64) (err error)
- func (s *Service) ProxyDeleteGameTokens(c context.Context, mid, appID int64) (err error)
- func (s *Service) ProxyDeleteToken(c context.Context, token string) (err error)
- func (s *Service) ProxyDeleteTokens(c context.Context, mid int64) (err error)
- func (s *Service) ProxyRenewToken(c context.Context, ak string) (res *model.Token, err error)
- func (s *Service) RSAKey(c context.Context) *model.RSAKey
- func (s *Service) RenewGameToken(c context.Context, ak string) (res *model.Token, err error)
- func (s *Service) TokenInfo(c context.Context, token string) (res *model.Token, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPrivateKeyError private key error ErrPrivateKeyError = errors.New("private key error") // ErrUnsupportedPriKey Private key error ErrUnsupportedPriKey = errors.New("unsupported private key") )
Functions ¶
func Hash2TsSeconds ¶
Hash2TsSeconds parse ts seconds from hash.
func IntStr2Md5 ¶
IntStr2Md5 converts big int string in base 10 to MD5 checksum bytes.
func MD52IntStr ¶
MD52IntStr converts MD5 checksum bytes to big int string in base 10.
func TsSeconds2Hash ¶
TsSeconds2Hash generate hash from seconds ts.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service struct
func (*Service) AddOldCookie ¶
AddOldCookie add old cookie
func (*Service) AddToken ¶
func (s *Service) AddToken(c context.Context, appID, mid int64) (res *model.RefreshTokenResp, err error)
AddToken add token
func (*Service) CheckUser ¶
func (s *Service) CheckUser(c context.Context, username, pwd string) (decodeUser *model.DecodeUser, err error)
CheckUser check username and pwd.
func (*Service) CookieInfo ¶
func (s *Service) CookieInfo(c context.Context, sessionData string) (cookie *model.CookieProto, err error)
CookieInfo cookie info by session.
func (*Service) DelCookieByMid ¶
DelCookieByMid delete cookie by mid
func (*Service) DelTokenByMid ¶
DelTokenByMid delete token by mid
func (*Service) ProxyAddCookie ¶
ProxyAddCookie proxy add cookie
func (*Service) ProxyAddToken ¶
func (s *Service) ProxyAddToken(c context.Context, appID, mid int64) (res *model.RefreshTokenResp, err error)
ProxyAddToken proxy add token
func (*Service) ProxyCheckUser ¶
func (s *Service) ProxyCheckUser(c context.Context, param *model.ParamLogin) (decodeUser *model.DecodeUser, err error)
ProxyCheckUser check user .
func (*Service) ProxyDeleteCookie ¶
ProxyDeleteCookie proxy delete cookie
func (*Service) ProxyDeleteCookies ¶
ProxyDeleteCookies proxy delete cookies
func (*Service) ProxyDeleteGameTokens ¶
ProxyDeleteGameTokens proxy delete tokens
func (*Service) ProxyDeleteToken ¶
ProxyDeleteToken proxy delete cookie
func (*Service) ProxyDeleteTokens ¶
ProxyDeleteTokens proxy delete tokens
func (*Service) ProxyRenewToken ¶
ProxyRenewToken renew game token
func (*Service) RenewGameToken ¶
RenewGameToken renew game token