Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type Data
- type Fetcher
- type Query
- type URLBuilder
- func (u *URLBuilder) BaseURL() (string, error)
- func (u *URLBuilder) Begin(id string) *URLBuilder
- func (u *URLBuilder) Build() (string, error)
- func (u *URLBuilder) Copy() *URLBuilder
- func (u *URLBuilder) End(id string) *URLBuilder
- func (u *URLBuilder) GachaType(gachaType string) *URLBuilder
- func (u *URLBuilder) GachaTypes(gachaTypes []string) []*URLBuilder
- func (u *URLBuilder) Reset() *URLBuilder
- func (u *URLBuilder) Size(size int) *URLBuilder
Constants ¶
View Source
const DefaultInterval = 500 * time.Millisecond // 默认请求间隔
View Source
const DefaultSize = 5 // 默认每页数量
Variables ¶
View Source
var LastRequestTime time.Time // 上次请求时间
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Fetcher ¶
type Fetcher struct { *Client *URLBuilder }
type Query ¶
type Query struct { AuthKeyVer string `url:"authkey_ver"` // 授权密钥版本 AuthKey string `url:"authkey"` // 授权密钥 Lang string `url:"lang"` // 语言 GachaType string `url:"gacha_type"` // 卡池类型 Size int `url:"size"` // 每页数量 BeginID string `url:"begin_id,omitempty"` // 开始 ID EndID string `url:"end_id,omitempty"` // 结束 ID }
Query 是抽卡记录 API 查询参数
type URLBuilder ¶
URLBuilder 用于构建抽卡记录 API 请求 URL
func NewURLBuilder ¶
func NewURLBuilder(auth *auths.Auth) *URLBuilder
NewURLBuilder 返回一个初始化的 URLBuilder
func (*URLBuilder) BaseURL ¶
func (u *URLBuilder) BaseURL() (string, error)
BaseURL 返回 hostname 对应的 GetGachaLog 基础 URL
func (*URLBuilder) Build ¶
func (u *URLBuilder) Build() (string, error)
func (*URLBuilder) Copy ¶
func (u *URLBuilder) Copy() *URLBuilder
func (*URLBuilder) GachaType ¶
func (u *URLBuilder) GachaType(gachaType string) *URLBuilder
GachaType 设置卡池类型
func (*URLBuilder) GachaTypes ¶
func (u *URLBuilder) GachaTypes(gachaTypes []string) []*URLBuilder
GachaTypes 返回多个卡池类型的 URL
func (*URLBuilder) Reset ¶
func (u *URLBuilder) Reset() *URLBuilder
Click to show internal directories.
Click to hide internal directories.