service

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPrivateKeyError private key error
	ErrPrivateKeyError = errors.New("private key error")
	// ErrUnsupportedPriKey Private key error
	ErrUnsupportedPriKey = errors.New("unsupported private key")
)

Functions

func Decrypt

func Decrypt(crypted []byte, key []byte) ([]byte, error)

Decrypt aes encrypt

func Encrypt

func Encrypt(origData []byte, key []byte) ([]byte, error)

Encrypt aes encrypt

func Hash2TsSeconds

func Hash2TsSeconds(timeHash string) (ts int64, err error)

Hash2TsSeconds parse ts seconds from hash.

func IntStr2Md5

func IntStr2Md5(intStr string) (res []byte)

IntStr2Md5 converts big int string in base 10 to MD5 checksum bytes.

func IsMail

func IsMail(mail string) bool

IsMail is mail

func IsTel

func IsTel(tel string) bool

IsTel isTel

func MD52IntStr

func MD52IntStr(md5d []byte) (res string)

MD52IntStr converts MD5 checksum bytes to big int string in base 10.

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

PKCS5Padding padding

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding unpadding

func TsSeconds2Hash

func TsSeconds2Hash(tsSecond int64) string

TsSeconds2Hash generate hash from seconds ts.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service struct

func New

func New(c *conf.Config) (s *Service)

New init

func (*Service) AddCookie

func (s *Service) AddCookie(c context.Context, mid int64) (res *model.CookieProto, err error)

AddCookie add cookie

func (*Service) AddOldCookie

func (s *Service) AddOldCookie(c context.Context, mid int64) (res *model.CookieProto, err error)

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) Close

func (s *Service) Close()

Close Service

func (*Service) CookieInfo

func (s *Service) CookieInfo(c context.Context, sessionData string) (cookie *model.CookieProto, err error)

CookieInfo cookie info by session.

func (*Service) DelCookie

func (s *Service) DelCookie(c context.Context, session string, mid int64) (err error)

DelCookie delete cookie

func (*Service) DelCookieByMid

func (s *Service) DelCookieByMid(c context.Context, mid int64) (err error)

DelCookieByMid delete cookie by mid

func (*Service) DelToken

func (s *Service) DelToken(c context.Context, token, refresh string) (err error)

DelToken delete token

func (*Service) DelTokenByMid

func (s *Service) DelTokenByMid(c context.Context, mid int64) (err error)

DelTokenByMid delete token by mid

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping Service

func (*Service) ProxyAddCookie

func (s *Service) ProxyAddCookie(c context.Context, mid int64) (res *model.CookieProto, err error)

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

func (s *Service) ProxyDeleteCookie(c context.Context, mid int64, session string) (err error)

ProxyDeleteCookie proxy delete cookie

func (*Service) ProxyDeleteCookies

func (s *Service) ProxyDeleteCookies(c context.Context, mid int64) (err error)

ProxyDeleteCookies proxy delete cookies

func (*Service) ProxyDeleteGameTokens

func (s *Service) ProxyDeleteGameTokens(c context.Context, mid, appID int64) (err error)

ProxyDeleteGameTokens proxy delete tokens

func (*Service) ProxyDeleteToken

func (s *Service) ProxyDeleteToken(c context.Context, token string) (err error)

ProxyDeleteToken proxy delete cookie

func (*Service) ProxyDeleteTokens

func (s *Service) ProxyDeleteTokens(c context.Context, mid int64) (err error)

ProxyDeleteTokens proxy delete tokens

func (*Service) ProxyRenewToken

func (s *Service) ProxyRenewToken(c context.Context, ak string) (res *model.Token, err error)

ProxyRenewToken renew game token

func (*Service) RSAKey

func (s *Service) RSAKey(c context.Context) *model.RSAKey

RSAKey get rsa pub key and seconds ts hash.

func (*Service) RenewGameToken

func (s *Service) RenewGameToken(c context.Context, ak string) (res *model.Token, err error)

RenewGameToken renew game token

func (*Service) TokenInfo

func (s *Service) TokenInfo(c context.Context, token string) (res *model.Token, err error)

TokenInfo get token

Jump to

Keyboard shortcuts

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