models

package
v0.0.0-...-60ee4e7 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeLayout = "2006-01-02 15:04:05"

	Domain = ".bilibili.com"
	Home   = "https://www.bilibili.com"

	APILogin = "https://api.bilibili.com/x/web-interface/nav"
	APISign  = "https://api.bilibili.com/x/member/web/coin/log?jsonp=jsonp"
	APICoin  = "https://account.bilibili.com/site/getCoin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	TTL     int             `json:"ttl"`
	Status  bool            `json:"status"`
	Data    json.RawMessage `json:"data"`
}

func NewAPIResponse

func NewAPIResponse(body io.Reader) (*APIResponse, error)

func (*APIResponse) CoinInfo

func (ar *APIResponse) CoinInfo() (*CoinInfo, error)

func (*APIResponse) LoginInfo

func (ar *APIResponse) LoginInfo() (*LoginInfo, error)

func (*APIResponse) SignInfo

func (ar *APIResponse) SignInfo() (*SignInfo, error)

type BiliBili

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

func NewBiliBili

func NewBiliBili(id, cookie string) (*BiliBili, error)

func (*BiliBili) Content

func (b *BiliBili) Content() string

func (*BiliBili) Run

func (b *BiliBili) Run() error

func (*BiliBili) Subject

func (b *BiliBili) Subject() string

type CoinInfo

type CoinInfo struct {
	Money int `json:"money"`
}

type LoginInfo

type LoginInfo struct {
	IsLogin bool   `json:"isLogin"`
	Money   int    `json:"money"`
	Uname   string `json:"uname"`
}

type SignEntry

type SignEntry struct {
	Time   string `json:"time"`
	Delta  int    `json:"delta"`
	Reason string `json:"reason"`
}

type SignInfo

type SignInfo struct {
	List  []*SignEntry `json:"list"`
	Count int          `json:"count"`
}

Jump to

Keyboard shortcuts

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