Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateDS(s string, payload any, query string) string
- func GenerateLabHeaders(cookie string, query string) map[string]string
- func SendRequest(r RequestInterface, payload any, v ResponseInterface) error
- type CookieToken
- type CookieTokenRequest
- type CookieTokenResponse
- type GameRecord
- type GameRecordData
- type GameRecordRequest
- type GameRecordResponse
- type GameRecordResponseData
- type GameToken
- type QrcodeCheckPool
- type QrcodeCheckTask
- type QrcodeFetchPayload
- type QrcodeFetchRequest
- type QrcodeFetchResponse
- type QrcodeFetchResponseData
- type QrcodeQueryPayload
- type QrcodeQueryRequest
- type QrcodeQueryResponse
- type QrcodeQueryResponseData
- type QrcodeQueryResponseDataPayload
- type Request
- type RequestInterface
- type Response
- type ResponseInterface
- type SToken
- type STokenPayload
- type STokenRequest
- type STokenResponse
- type STokenResponseData
- type UserInfo
Constants ¶
View Source
const ( LabUA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) miHoYoBBS/" + XRpcVersion LabMobileUA = "Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/106.0.5249.126 Mobile Safari/537.36 miHoYoBBS/" + XRpcVersion //nolint:lll OkHTTPUA = "okhttp/4.8.0" )
View Source
const (
XRpcVersion = "2.44.1"
)
Variables ¶
View Source
var ( ErrInvalidPayload = errors.New("invalid payload") ErrRequestBodyInvalid = errors.New("request body invalid") )
View Source
var ErrQrcodeLoginNotConfirmed = errors.New("QR code login not confirmed")
Functions ¶
func SendRequest ¶
func SendRequest(r RequestInterface, payload any, v ResponseInterface) error
Types ¶
type CookieToken ¶
type CookieTokenRequest ¶
type CookieTokenRequest struct { Request AccountID string `json:"account_id"` GameToken string `json:"game_token"` }
func NewCookieTokenReq ¶
func NewCookieTokenReq(id, token string) *CookieTokenRequest
func (*CookieTokenRequest) Do ¶
func (r *CookieTokenRequest) Do() (*CookieToken, error)
type CookieTokenResponse ¶
type CookieTokenResponse struct { Response Data CookieToken `json:"data"` }
type GameRecord ¶
type GameRecordData ¶
type GameRecordRequest ¶
type GameRecordRequest struct { Request AccountID string `json:"account_id"` CookieToken string `json:"cookie_token"` }
func NewGameRecordReq ¶
func NewGameRecordReq(id, cookieToken string) *GameRecordRequest
func (*GameRecordRequest) Do ¶
func (r *GameRecordRequest) Do() (*GameRecordResponseData, error)
type GameRecordResponse ¶
type GameRecordResponse struct { Response Data GameRecordResponseData `json:"data"` }
type GameRecordResponseData ¶
type GameRecordResponseData struct {
GameRecords []GameRecord `json:"list"`
}
type QrcodeCheckPool ¶
type QrcodeCheckPool struct { Tasks chan QrcodeCheckTask // contains filtered or unexported fields }
func NewQrcodeCheckPool ¶
func NewQrcodeCheckPool() *QrcodeCheckPool
func (*QrcodeCheckPool) Add ¶
func (p *QrcodeCheckPool) Add(ctx telebot.Context, userID int64, r *QrcodeQueryRequest)
func (*QrcodeCheckPool) IsRunning ¶
func (p *QrcodeCheckPool) IsRunning(userID int64) bool
func (*QrcodeCheckPool) Worker ¶
func (p *QrcodeCheckPool) Worker()
type QrcodeCheckTask ¶
type QrcodeCheckTask struct { Context telebot.Context UserID int64 QrcodeQuery *QrcodeQueryRequest }
func (*QrcodeCheckTask) ProcessingToken ¶
func (t *QrcodeCheckTask) ProcessingToken(raw string)
type QrcodeFetchPayload ¶
type QrcodeFetchRequest ¶
type QrcodeFetchRequest struct {
Request
}
func NewQrcodeFetch ¶
func NewQrcodeFetch() *QrcodeFetchRequest
func (*QrcodeFetchRequest) Do ¶
func (r *QrcodeFetchRequest) Do() (*QrcodeFetchResponseData, error)
type QrcodeFetchResponse ¶
type QrcodeFetchResponse struct { Response Data QrcodeFetchResponseData `json:"data"` }
type QrcodeFetchResponseData ¶
type QrcodeQueryPayload ¶
type QrcodeQueryRequest ¶
type QrcodeQueryRequest struct { Request QrcodeQueryPayload }
func NewQrcodeQuery ¶
func NewQrcodeQuery(appID int, device string, ticket string) *QrcodeQueryRequest
func (*QrcodeQueryRequest) Do ¶
func (r *QrcodeQueryRequest) Do() (*QrcodeQueryResponseData, error)
func (*QrcodeQueryRequest) ParseGameToken ¶
func (r *QrcodeQueryRequest) ParseGameToken(raw string) (*GameToken, error)
type QrcodeQueryResponse ¶
type QrcodeQueryResponse struct { Response Data QrcodeQueryResponseData `json:"data"` }
type QrcodeQueryResponseData ¶
type QrcodeQueryResponseData struct { Stat string `json:"stat"` Payload QrcodeQueryResponseDataPayload `json:"payload"` }
type Request ¶
type Request struct { URL string `json:"url"` Method string `json:"method"` Headers map[string]string `json:"headers"` }
func (*Request) GetHeaders ¶
type RequestInterface ¶
type Response ¶
func (*Response) GetRetCode ¶
type ResponseInterface ¶
type ResponseInterface interface {
GetRetCode() int
}
type STokenPayload ¶
type STokenRequest ¶
type STokenRequest struct { Request STokenPayload }
func NewSTokenReq ¶
func NewSTokenReq(id int64, token string) *STokenRequest
func (*STokenRequest) Do ¶
func (r *STokenRequest) Do() (*STokenResponseData, error)
type STokenResponse ¶
type STokenResponse struct { Response Data STokenResponseData `json:"data"` }
type STokenResponseData ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.