v1

package
v0.0.0-...-ee699aa Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Illust       *Illust
	User         *User
	Search       *Search
	TrendingTags *TrendingTags
}

func NewAPI

func NewAPI(client pixiv.Session) *API

func (*API) DoGet

func (a *API) DoGet(ctx context.Context, path string, params map[string]string) (interface{}, error)

type Illust

type Illust struct {
	BasePath string
	// contains filtered or unexported fields
}

func NewIllust

func NewIllust(client pixiv.Session) *Illust

func (*Illust) Detail

func (i *Illust) Detail(ctx context.Context, illustID uint64) (*pixiv.Illust, error)

func (*Illust) Illust

func (i *Illust) Illust(ctx context.Context) ([]*pixiv.TrendingTag, error)

func (*Illust) Ranking

func (i *Illust) Ranking(ctx context.Context, q *RankingQuery) ([]*pixiv.Illust, string, error)

func (*Illust) Recommended

func (i *Illust) Recommended(ctx context.Context, q *IllustRecommendedQuery) ([]*pixiv.Illust, string, error)

type IllustRecommendedQuery

type IllustRecommendedQuery struct {
	MinBookmarkIDForRecentIllust uint64 `url:"min_bookmark_id_for_recent_illust,omitempty"`
	MaxBookmarkIDForRecommend    uint64 `url:"max_bookmark_id_for_recommend,omitempty"`
	Offset                       int    `url:"offset,omitempty"`
}

type RankingMode

type RankingMode string
const (
	RankingModeDay          RankingMode = "day"
	RankingModeWeek         RankingMode = "week"
	RankingModeMonth        RankingMode = "month"
	RankingModeDayMale      RankingMode = "male"
	RankingModeDayFemale    RankingMode = "female"
	RankingModeWeekOriginal RankingMode = "week_original"
	RankingModeWeekRookie   RankingMode = "week_rookie"
	RankingModeDayR18       RankingMode = "day_r18"
	RankingModeDayMaleR18   RankingMode = "day_male_r18"
	RankingModeDayFemaleR18 RankingMode = "day_female_r18"
	RankingModeWeekR18      RankingMode = "week_r18"
	RankingModeWeekR18G     RankingMode = "week_r18g"
)

type RankingQuery

type RankingQuery struct {
	Mode RankingMode `url:"mode"`
	// yyyy-mm-dd  (2006-01-02)
	Date   string `url:"date,omitempty"`
	Offset int    `url:"offset,omitempty"`
}
type Search struct {
	BasePath string
	// contains filtered or unexported fields
}

func NewSearch

func NewSearch(client pixiv.Session) *Search

func (*Search) Illust

func (s *Search) Illust(ctx context.Context, q *SearchIllustQuery) ([]*pixiv.Illust, string, error)

type SearchIllustQuery

type SearchIllustQuery struct {
	Word         string       `url:"word"`
	SearchTarget SearchTarget `url:"search_target"`

	Sort           SearchSortOrder `url:"sort,omitempty"`
	BookmarkNumMin int             `url:"bookmark_num_min,omitempty"`
	BookmarkNumMax int             `url:"bookmark_num_max,omitempty"`
	// yyyy-mm-dd (2006-01-02)
	StartDate string `url:"start_date,omitempty"`
	// yyyy-mm-dd (2006-01-02)
	EndDate string `url:"end_date,omitempty"`
}

type SearchSortOrder

type SearchSortOrder string
const (
	SearchSortOrderDateDesc          SearchSortOrder = "date_desc"
	SearchSortOrderDateAsc           SearchSortOrder = "date_asc"
	SearchSortOrderPopularDesc       SearchSortOrder = "popular_desc"
	SearchSortOrderPopularMaleDesc   SearchSortOrder = "popular_male_desc"
	SearchSortOrderPopularFemaleDesc SearchSortOrder = "popular_female_desc"
)

type SearchTarget

type SearchTarget string
const (
	SearchTargetPartialMatchForTags SearchTarget = "partial_match_for_tags"
	SearchTargetExactMatchForTags   SearchTarget = "exact_match_for_tags"
	SearchTargetTitleAndCaption     SearchTarget = "title_and_caption"
)

type TrendingTags

type TrendingTags struct {
	BasePath string
	// contains filtered or unexported fields
}

func NewTrendingTags

func NewTrendingTags(client pixiv.Session) *TrendingTags

type User

type User struct {
	BasePath string
	// contains filtered or unexported fields
}

func NewUser

func NewUser(client pixiv.Session) *User

func (*User) Detail

func (u *User) Detail(ctx context.Context, userID uint64) (*pixiv.UserDetails, error)

func (*User) Following

func (u *User) Following(ctx context.Context, q *UserFollowingQuery) ([]*pixiv.UserPreview, string, error)

func (*User) Illusts

func (u *User) Illusts(ctx context.Context, q *UserIllustQuery) ([]*pixiv.Illust, string, error)

type UserFollowingQuery

type UserFollowingQuery struct {
	UserID uint64 `url:"user_id"`
	// public, private
	Restrict string `url:"restrict,omitempty"`
}

type UserIllustQuery

type UserIllustQuery struct {
	UserID uint64 `url:"user_id"`
	// illust, manga, novel
	Type string `url:"type"`
}

Jump to

Keyboard shortcuts

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