Documentation
¶
Index ¶
- type Book
- type Category
- type Chapter
- type Expense
- type OfficialTagsResult
- type Order
- type RankOption
- type RankOptions
- type RankPeriod
- type RankResult
- type RankType
- type SearchOption
- func SearchOptionCategory(category Category) SearchOption
- func SearchOptionExpense(expense Expense) SearchOption
- func SearchOptionOrder(order Order) SearchOption
- func SearchOptionPageIndex(n int) SearchOption
- func SearchOptionPageSize(n int) SearchOption
- func SearchOptionQuery(query string) SearchOption
- func SearchOptionTag(tags ...string) SearchOption
- func SearchOptionUpdateStatus(updateStatus UpdateStatus) SearchOption
- func SearchOptionUpdateTime(updateTimeRange UpdateTimeRange) SearchOption
- func SearchOptionWordCount(wordCountRange WordCountRange) SearchOption
- type SearchOptions
- type SearchResult
- type Tag
- type UpdateStatus
- type UpdateTimeRange
- type WordCountRange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct {
ID string
Title string
CoverURL string
Description string
Author string
Category Category
Created time.Time
Updated time.Time
UpdateStatus UpdateStatus
WordCount uint64
ChapterCount uint64
ClickCount uint64
RecommendCount uint64
BookmarkCount uint64
MonthlyTicketCount uint64
BladeCount uint64
FanValue uint64
ReviewCount uint64
RewardCount uint64
MonthClickCount uint64
MonthNoVIPClickCount uint64
MonthRecommendCount uint64
MonthBookmarkCount uint64
MonthFanValue uint64
WeekClickCount uint64
WeekNoVIPClickCount uint64
WeekRecommendCount uint64
WeekBookmarkCount uint64
WeekFanValue uint64
TotalBladeCount uint64
TotalMonthlyTicketCount uint64
LastChapter Chapter
Tags []Tag
}
type OfficialTagsResult ¶
func OfficialTags ¶
func OfficialTags(ctx context.Context) (ret OfficialTagsResult, err error)
func (OfficialTagsResult) Tags ¶
func (res OfficialTagsResult) Tags() (ret []Tag)
type Order ¶
type Order string
var ( OAverageSale Order = "average_buy" OMonthlyTicket Order = "total_yp" OMonthNoVIPClick Order = "month_no_vip_click" OTotalBookmark Order = "total_favor" OTotalClick Order = "total_click" OTotalRecommend Order = "total_recommend" OTotalWordCount Order = "total_word_count" OUpdateTime Order = "uptime" OWeekClick Order = "week_click" OWeekNoVIPClick Order = "week_no_vip_click" )
type RankOption ¶
type RankOption = func(opts *RankOptions)
func RankOptionCategory ¶
func RankOptionCategory(category Category) RankOption
func RankOptionPageIndex ¶
func RankOptionPageIndex(n int) RankOption
func RankOptionPageSize ¶
func RankOptionPageSize(n int) RankOption
RankOptionPageSize, defaults to 10. max page size is 20 (2021-06-28)
type RankOptions ¶
type RankOptions struct {
// contains filtered or unexported fields
}
type RankPeriod ¶
type RankPeriod string
var ( // RPWeek means less than a week for some rank type. RPWeek RankPeriod = "week" RPMonth RankPeriod = "month" RPTotal RankPeriod = "total" )
type RankResult ¶
func Rank ¶
func Rank(ctx context.Context, rankType RankType, period RankPeriod, opts ...RankOption) (ret RankResult, err error)
func (RankResult) Books ¶
func (res RankResult) Books() []Book
type RankType ¶
type RankType string
var ( // 点击 RTClick RankType = "no_vip_click" // 畅销 RTSales RankType = "fans_value" // 月票 RTMonthlyTicket RankType = "yp" // 新书 RTNewBook RankType = "yp_new" // 收藏 RTBookmark RankType = "favor" // 推荐 RTRecommend RankType = "recommend" // 刀片 RTBlade RankType = "blade" // 更新 RTWordCount RankType = "word_count" // 吐槽 RTTsukkomi RankType = "tsukkomi" // 完本 RTFinished RankType = "complet" // 追读 RTWatching RankType = "track_read" )
type SearchOption ¶
type SearchOption = func(opts *SearchOptions)
func SearchOptionCategory ¶
func SearchOptionCategory(category Category) SearchOption
func SearchOptionExpense ¶
func SearchOptionExpense(expense Expense) SearchOption
func SearchOptionOrder ¶
func SearchOptionOrder(order Order) SearchOption
func SearchOptionPageIndex ¶
func SearchOptionPageIndex(n int) SearchOption
func SearchOptionPageSize ¶
func SearchOptionPageSize(n int) SearchOption
SearchOptionPageSize specify result count, defaults to 10
func SearchOptionQuery ¶
func SearchOptionQuery(query string) SearchOption
func SearchOptionTag ¶
func SearchOptionTag(tags ...string) SearchOption
func SearchOptionUpdateStatus ¶
func SearchOptionUpdateStatus(updateStatus UpdateStatus) SearchOption
func SearchOptionUpdateTime ¶
func SearchOptionUpdateTime(updateTimeRange UpdateTimeRange) SearchOption
func SearchOptionWordCount ¶
func SearchOptionWordCount(wordCountRange WordCountRange) SearchOption
type SearchOptions ¶
type SearchOptions struct {
// contains filtered or unexported fields
}
SearchOptions contains merged SearchOption result
type SearchResult ¶
func Search ¶
func Search(ctx context.Context, opts ...SearchOption) (ret SearchResult, err error)
func (SearchResult) Books ¶
func (res SearchResult) Books() (ret []Book)
type UpdateStatus ¶
type UpdateStatus string
var ( UpdateStatusUndefined UpdateStatus = "" UpdateStatusNotFinished UpdateStatus = "0" UpdateStatusFinished UpdateStatus = "1" )
type UpdateTimeRange ¶
type UpdateTimeRange string
var ( UpdateTimeUndefined UpdateTimeRange = "" UpdateTimeIn3Days UpdateTimeRange = "1" UpdateTimeIn7Days UpdateTimeRange = "2" UpdateTimeInHalfMonth UpdateTimeRange = "3" UpdateTimeInMonth UpdateTimeRange = "4" )
type WordCountRange ¶
type WordCountRange string
var ( WordCountUndefined WordCountRange = "" WordCountLt300k WordCountRange = "1" WordCountGt300kLt50k WordCountRange = "2" WordCountGt500kLt1m WordCountRange = "3" WordCountGt1mLt2m WordCountRange = "4" WordCountGt2m WordCountRange = "5" )
Click to show internal directories.
Click to hide internal directories.