fetcher

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInterval = 500 * time.Millisecond
)

Variables

This section is empty.

Functions

func FetchAllWishHistory

func FetchAllWishHistory(baseURL string, items wish.Items) (wish.Items, error)

Types

type AuthInfo

type AuthInfo struct {
	UID     string `toml:"uid"`
	BaseURL string `toml:"base_url"`
}

type Fetcher

type Fetcher struct {
	BaseURL  string
	Visit    map[int64]bool
	Interval time.Duration

	*QP
}

func New

func New(baseURL string, wishType wish.Type, visit map[int64]bool) *Fetcher

func (*Fetcher) Fetch

func (f *Fetcher) Fetch() (items wish.Items, err error)

func (*Fetcher) FetchALL

func (f *Fetcher) FetchALL() (wish.Items, error)

func (*Fetcher) FetchNext

func (f *Fetcher) FetchNext() (wish.Items, error)

func (*Fetcher) URL

func (f *Fetcher) URL() string

type QP

type QP struct {
	WishType int   `url:"gacha_type"`
	Page     int   `url:"page"`
	Size     int   `url:"size"`
	EndID    int64 `url:"end_id"`
}

QP Query Parameters

func NewQP

func NewQP(wishType int) *QP

func (*QP) Values

func (qp *QP) Values() url.Values

Jump to

Keyboard shortcuts

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