Documentation ¶
Index ¶
- type Artwork
- type ContentRating
- type Order
- type Page
- type Rank
- type RankItem
- type SearchMode
- type SearchOption
- func SearchOptionContentRating(rating ContentRating) SearchOption
- func SearchOptionMode(mode SearchMode) SearchOption
- func SearchOptionOrder(order Order) SearchOption
- func SearchOptionPage(page int) SearchOption
- func SearchOptionResolution(widthLessThan, widthGreaterThan, heightLessThan, heightGreaterThan int64) SearchOption
- type SearchOptions
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artwork ¶
type Artwork struct { ID string Title string Type string Description string Image image.URLs Created time.Time Tags []string Author user.User Width int64 Height int64 PageCount int64 CommentCount int64 LikeCount int64 ViewCount int64 BookmarkCount int64 Pages []Page }
Artwork data
func (*Artwork) FetchPages ¶
FetchPages get all pages for artwork from pixiv artwork pages api,
type ContentRating ¶ added in v0.5.0
type ContentRating string
ContentRating of a artwork
var ( // all content (default) ContentRatingAll ContentRating = "" // content that suitable for all ages ContentRatingSafe ContentRating = "safe" // restricted r18+ content ContentRatingR18 ContentRating = "r18" )
content ratings
type Rank ¶
type Rank struct { /* required, possible rank modes: - daily (default) - weekly - monthly - rookie - original - male - female - daily_r18 - weekly_r18 - male_r18 - female_r18 - r18g */ Mode string /* optional, possible rank content: - all (default) - illust - ugoira - manga */ Content string Date time.Time Page int Items []RankItem }
Rank contains data for one rank page.
type SearchMode ¶ added in v0.5.0
type SearchMode string
SearchMode to match artwork
var ( // exact tag match (default) SearchModeTag SearchMode = "" // partial tag match SearchModePartialTag SearchMode = "s_tag" // title or caption match SearchModeTitleOrCaption SearchMode = "s_tc" )
search modes
type SearchOption ¶ added in v0.4.0
type SearchOption func(*SearchOptions)
SearchOption mutate SearchOptions
func SearchOptionContentRating ¶ added in v0.5.0
func SearchOptionContentRating(rating ContentRating) SearchOption
SearchOptionContentRating filter result by content rating
func SearchOptionMode ¶ added in v0.4.2
func SearchOptionMode(mode SearchMode) SearchOption
SearchOptionMode change search mode
func SearchOptionOrder ¶ added in v0.4.2
func SearchOptionOrder(order Order) SearchOption
SearchOptionOrder change result order
func SearchOptionPage ¶ added in v0.4.0
func SearchOptionPage(page int) SearchOption
SearchOptionPage change page to retrive
func SearchOptionResolution ¶ added in v0.5.0
func SearchOptionResolution( widthLessThan, widthGreaterThan, heightLessThan, heightGreaterThan int64, ) SearchOption
SearchOptionResolution filter result by original image resolution, use 0 to unset limit.
type SearchOptions ¶ added in v0.4.0
type SearchOptions struct { Page int Order Order ContentRating ContentRating Mode SearchMode WidthLessThan int64 WidthGreaterThan int64 HeightLessThan int64 HeightGreaterThan int64 }
SearchOptions for Search see SearchOption* functions for documention.
type SearchResult ¶
SearchResult holds search data and provide useful methods.
func Search ¶
func Search(ctx context.Context, query string, opts ...SearchOption) (result SearchResult, err error)
Search calls pixiv artwork search api.
func (SearchResult) Artworks ¶
func (r SearchResult) Artworks() []Artwork
Artworks appeared in search result.