Documentation
¶
Overview ¶
Package login contains parameters and response models for Bilibili login and authenticated-session state.
Index ¶
- Constants
- type AccountInfo
- type Captcha
- type CaptchaPayload
- type Client
- func (l Client) AccountInfo(ctx context.Context) (AccountInfo, error)
- func (l Client) Coin(ctx context.Context) (CoinBalance, error)
- func (l Client) DailyReward(ctx context.Context) (DailyReward, error)
- func (l Client) GenerateCaptcha(ctx context.Context) (Captcha, error)
- func (l Client) GenerateQR(ctx context.Context) (QRGenerate, error)
- func (l Client) Log(ctx context.Context, params LogParams) (Log, error)
- func (l Client) Nav(ctx context.Context) (Nav, error)
- func (l Client) Notice(ctx context.Context, params NoticeParams) (Notice, error)
- func (l Client) PollQR(ctx context.Context, params QRPollParams) (QRStatus, error)
- func (l Client) QRFlow(ctx context.Context) (QRFlow, error)
- func (l Client) Stat(ctx context.Context) (Stats, error)
- func (l Client) TodayCoinExp(ctx context.Context) (TodayCoinExp, error)
- func (l Client) VIPInfo(ctx context.Context) (VIPInfo, error)
- type CoinBalance
- type DailyReward
- type Geetest
- type Log
- type LogEntry
- type LogParams
- type Nav
- type Notice
- type NoticeParams
- type QRFlow
- type QRGenerate
- type QRPollParams
- type QRStatus
- type Stats
- type TodayCoinExp
- type VIPInfo
- type WBIImage
Constants ¶
View Source
const ( QRSuccess int32 = 0 QRExpired int32 = 86038 QRScannedUnconfirmed int32 = 86090 QRWaiting int32 = 86101 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶
type CaptchaPayload ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides login and authenticated-session operations.
func (Client) AccountInfo ¶
func (l Client) AccountInfo(ctx context.Context) (AccountInfo, error)
func (Client) DailyReward ¶
func (l Client) DailyReward(ctx context.Context) (DailyReward, error)
func (Client) GenerateCaptcha ¶
func (Client) GenerateQR ¶
func (l Client) GenerateQR(ctx context.Context) (QRGenerate, error)
func (Client) Nav ¶
Nav gets the current session's navigation/login state. Anonymous sessions normally return an API error for which RequiresLogin reports true.
func (Client) QRFlow ¶
QRFlow generates a QR login challenge and immediately performs one poll. Callers can continue polling with PollQR and the returned Generate.Key.
func (Client) TodayCoinExp ¶
func (l Client) TodayCoinExp(ctx context.Context) (TodayCoinExp, error)
type CoinBalance ¶
type CoinBalance struct {
Money float64 `json:"money"`
}
type DailyReward ¶
type LogParams ¶
type LogParams struct {
// contains filtered or unexported fields
}
func NewLogParams ¶
func NewLogParams() LogParams
type Nav ¶
type Nav struct {
}
Nav is the stable login/navigation state returned by login.nav.
func (*Nav) UnmarshalJSON ¶
UnmarshalJSON normalizes guest zero/blank identity fields to nil while retaining strict validation for non-zero member IDs.
type NoticeParams ¶
type NoticeParams struct {
// contains filtered or unexported fields
}
func NewNoticeParams ¶
func NewNoticeParams(mid ids.MID) NoticeParams
func (NoticeParams) EncodeQuery ¶
func (p NoticeParams) EncodeQuery() (url.Values, error)
func (NoticeParams) WithBuvid ¶
func (p NoticeParams) WithBuvid(buvid string) (NoticeParams, error)
type QRFlow ¶
type QRFlow struct {
Generate QRGenerate
Poll QRStatus
}
type QRGenerate ¶
type QRPollParams ¶
type QRPollParams struct {
// contains filtered or unexported fields
}
func NewQRPollParams ¶
func NewQRPollParams(key string) (QRPollParams, error)
func (QRPollParams) EncodeQuery ¶
func (p QRPollParams) EncodeQuery() (url.Values, error)
type QRStatus ¶
type QRStatus struct {
URL string `json:"url"`
RefreshToken string `json:"refresh_token"`
Timestamp uint64 `json:"timestamp"`
Code int32 `json:"code"`
Message string `json:"message"`
Cookies map[string]string `json:"-"`
}
func (QRStatus) Authenticated ¶
type TodayCoinExp ¶
type TodayCoinExp uint32
Click to show internal directories.
Click to hide internal directories.