Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type Client
- func (c *Client) AddBookmark(ctx context.Context, illustID int64, restrict string, tags []string) error
- func (c *Client) FollowUser(ctx context.Context, userID int64, restrict string) error
- func (c *Client) IllustDetail(ctx context.Context, id int64) (*model.IllustDetail, error)
- func (c *Client) IllustFollow(ctx context.Context, restrict string, offset int) (*model.IllustList, error)
- func (c *Client) IllustRanking(ctx context.Context, mode, date string, offset int) (*model.IllustList, error)
- func (c *Client) IllustRecommended(ctx context.Context, offset int, continuationExists bool) (*model.IllustList, error)
- func (c *Client) IllustRelated(ctx context.Context, id int64, offset int) (*model.IllustList, error)
- func (c *Client) MangaRecommended(ctx context.Context, offset int, continuationExists bool) (*model.IllustList, error)
- func (c *Client) NovelRecommended(ctx context.Context, offset int, continuationExists bool) (*model.NovelList, error)
- func (c *Client) RemoveBookmark(ctx context.Context, illustID int64) error
- func (c *Client) SearchIllust(ctx context.Context, word, target, sort, duration, startDate, endDate string, ...) (*model.IllustList, error)
- func (c *Client) SearchIllustOptions(ctx context.Context, word string) (*model.SearchIllustOptions, error)
- func (c *Client) SearchNovel(ctx context.Context, word, target, sort, duration string, offset int) (*model.NovelList, error)
- func (c *Client) SearchUser(ctx context.Context, word string, offset int) (*model.UserPreviewList, error)
- func (c *Client) TrendingTagsIllust(ctx context.Context) (*model.TrendTags, error)
- func (c *Client) UgoiraMetadata(ctx context.Context, id int64) (*model.UgoiraMetadataResult, error)
- func (c *Client) UnfollowUser(ctx context.Context, userID int64) error
- func (c *Client) UserArtworks(ctx context.Context, userID int64, illustType string, offset int) (*model.IllustList, error)
- func (c *Client) UserBookmarks(ctx context.Context, userID int64, restrict, tag string, maxBookmarkID int64) (*model.IllustList, error)
- func (c *Client) UserDetail(ctx context.Context, userID int64) (*model.UserDetail, error)
- func (c *Client) UserFollowing(ctx context.Context, userID int64, restrict string, offset int) (*model.UserPreviewList, error)
- func (c *Client) UserRecommended(ctx context.Context, offset int, continuationExists bool) (*model.RecommendedUserList, error)
- type Option
- type Session
Constants ¶
View Source
const ( DefaultAPIBase = protocol.AppAPIBase DefaultUserAgent = protocol.AppUserAgent DefaultAppOS = protocol.AppOS DefaultAppOSVersion = protocol.AppOSVersion DefaultAppVersion = protocol.AppVersion )
Variables ¶
View Source
var ErrMalformedResponse = protocol.ErrMalformedResponse
ErrMalformedResponse 标识成功 HTTP 响应无法构成约定 JSON,不包含原始响应体。
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddBookmark ¶
func (c *Client) AddBookmark(ctx context.Context, illustID int64, restrict string, tags []string) error
AddBookmark 收藏作品。成功响应可为空,因此不走 JSON 解码路径。
func (*Client) FollowUser ¶
FollowUser 关注用户。
func (*Client) IllustDetail ¶
func (*Client) IllustFollow ¶
func (*Client) IllustRanking ¶
func (*Client) IllustRecommended ¶
func (*Client) IllustRelated ¶
func (*Client) MangaRecommended ¶ added in v0.3.0
func (c *Client) MangaRecommended(ctx context.Context, offset int, continuationExists bool) (*model.IllustList, error)
MangaRecommended 使用插画推荐 catalog 的漫画筛选;Pixiv 没有独立 manga 推荐 endpoint。
func (*Client) NovelRecommended ¶ added in v0.3.0
func (c *Client) NovelRecommended(ctx context.Context, offset int, continuationExists bool) (*model.NovelList, error)
NovelRecommended 返回小说推荐的单个 App API 批次。
func (*Client) RemoveBookmark ¶
RemoveBookmark 取消收藏作品。
func (*Client) SearchIllust ¶
func (c *Client) SearchIllust(ctx context.Context, word, target, sort, duration, startDate, endDate string, offset int, filterOptions ...model.SearchIllustFilters) (*model.IllustList, error)
func (*Client) SearchIllustOptions ¶ added in v0.4.0
func (*Client) SearchNovel ¶ added in v0.6.0
func (c *Client) SearchNovel(ctx context.Context, word, target, sort, duration string, offset int) (*model.NovelList, error)
SearchNovel 返回一个 App API 小说搜索批次。小说搜索不复用推荐接口的 offset=0 continuation 语义。
func (*Client) SearchUser ¶
func (*Client) TrendingTagsIllust ¶
func (*Client) UgoiraMetadata ¶
func (*Client) UnfollowUser ¶
UnfollowUser 取消关注用户。
func (*Client) UserArtworks ¶
func (c *Client) UserArtworks(ctx context.Context, userID int64, illustType string, offset int) (*model.IllustList, error)
UserArtworks 返回用户作品的单个 App API 批次。
func (*Client) UserBookmarks ¶
func (*Client) UserDetail ¶
func (*Client) UserFollowing ¶
func (*Client) UserRecommended ¶ added in v0.3.0
func (c *Client) UserRecommended(ctx context.Context, offset int, continuationExists bool) (*model.RecommendedUserList, error)
UserRecommended 返回作者推荐及其可用作品预览的单个 App API 批次。
type Option ¶
type Option func(*Client)
func WithAccessToken ¶
WithAccessToken 注入已取得的 access token,供无需刷新流程的 SDK 调用复用 App API。
func WithBaseURL ¶
func WithHTTPClient ¶
func WithLogger ¶ added in v0.5.0
WithLogger 注入调用方显式提供的安全诊断 logger;nil 保持静默。
func WithSession ¶
Click to show internal directories.
Click to hide internal directories.