Documentation
¶
Index ¶
- func IsNotFoundError(err error) bool
- type Client
- func (c *Client) Close()
- func (c *Client) CreateArticle(ctx context.Context, title, content string, topicIDs []string, ...) (map[string]any, error)
- func (c *Client) CreateComment(ctx context.Context, resourceType, resourceID, content string) (map[string]any, error)
- func (c *Client) CreatePin(ctx context.Context, title, content string, imageInfos []map[string]any) (map[string]any, error)
- func (c *Client) CreateQuestion(ctx context.Context, title, detail string, topicIDs []string, ...) (map[string]any, error)
- func (c *Client) DeleteArticle(ctx context.Context, articleID string) (bool, error)
- func (c *Client) DeleteComment(ctx context.Context, commentID string) (bool, error)
- func (c *Client) DeletePin(ctx context.Context, pinID string) (bool, error)
- func (c *Client) DeleteQuestion(ctx context.Context, questionID string) (bool, error)
- func (c *Client) FollowQuestion(ctx context.Context, questionID string) (bool, error)
- func (c *Client) GetAnswer(ctx context.Context, answerID string) (map[string]any, error)
- func (c *Client) GetAnswerComments(ctx context.Context, answerID string, offset, limit int, order string) (map[string]any, error)
- func (c *Client) GetArticle(ctx context.Context, articleID string) (map[string]any, error)
- func (c *Client) GetChildCommentsPage(ctx context.Context, commentID, cursor string, limit int) (map[string]any, error)
- func (c *Client) GetCollections(ctx context.Context, offset, limit int) (map[string]any, error)
- func (c *Client) GetComment(ctx context.Context, commentID string) (map[string]any, error)
- func (c *Client) GetComments(ctx context.Context, resourceType, resourceID string, offset, limit int, ...) (map[string]any, error)
- func (c *Client) GetCommentsPage(ctx context.Context, resourceType, resourceID, cursor string, limit int, ...) (map[string]any, error)
- func (c *Client) GetFeed(ctx context.Context, limit int) (map[string]any, error)
- func (c *Client) GetFollowers(ctx context.Context, urlToken string, offset, limit int) (map[string]any, error)
- func (c *Client) GetFollowing(ctx context.Context, urlToken string, offset, limit int) (map[string]any, error)
- func (c *Client) GetFollowingFeed(ctx context.Context, nextURL string, limit int) (map[string]any, error)
- func (c *Client) GetHotList(ctx context.Context, limit int) (map[string]any, error)
- func (c *Client) GetNotifications(ctx context.Context, limit, offset int, entryName string) (map[string]any, error)
- func (c *Client) GetPin(ctx context.Context, pinID string) (map[string]any, error)
- func (c *Client) GetQuestion(ctx context.Context, questionID string) (map[string]any, error)
- func (c *Client) GetQuestionAnswers(ctx context.Context, questionID string, offset, limit int, sortBy string) (map[string]any, error)
- func (c *Client) GetSelfInfo(ctx context.Context) (map[string]any, error)
- func (c *Client) GetUserAnswers(ctx context.Context, urlToken string, offset, limit int, sortBy string) (map[string]any, error)
- func (c *Client) GetUserArticles(ctx context.Context, urlToken string, offset, limit int, sortBy string) (map[string]any, error)
- func (c *Client) GetUserProfile(ctx context.Context, urlToken string) (map[string]any, error)
- func (c *Client) LikeComment(ctx context.Context, commentID string) (bool, error)
- func (c *Client) MarkAllNotificationsRead(ctx context.Context) error
- func (c *Client) MarkNotificationsRead(ctx context.Context, tab string) error
- func (c *Client) ReplyComment(ctx context.Context, commentID, content string) (map[string]any, error)
- func (c *Client) ReplyCommentToResource(ctx context.Context, resourceType, resourceID, commentID, content string) (map[string]any, error)
- func (c *Client) Search(ctx context.Context, keyword, searchType string, offset, limit int) (map[string]any, error)
- func (c *Client) SetContentVote(ctx context.Context, contentType, contentID string, voted bool) (bool, error)
- func (c *Client) UnfollowQuestion(ctx context.Context, questionID string) (bool, error)
- func (c *Client) UnlikeComment(ctx context.Context, commentID string) (bool, error)
- func (c *Client) UploadImage(ctx context.Context, filePath, source string) (map[string]any, error)
- func (c *Client) VoteNeutral(ctx context.Context, answerID string) (bool, error)
- func (c *Client) VoteUp(ctx context.Context, answerID string) (bool, error)
- type DataFetchError
- type Endpoints
- type LoginError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundError ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithHTTP ¶
func (*Client) CreateArticle ¶
func (*Client) CreateComment ¶
func (*Client) CreateQuestion ¶
func (*Client) DeleteArticle ¶
func (*Client) DeleteComment ¶
func (*Client) DeleteQuestion ¶
func (*Client) FollowQuestion ¶
func (*Client) GetAnswerComments ¶
func (*Client) GetArticle ¶
func (*Client) GetChildCommentsPage ¶
func (*Client) GetCollections ¶
func (*Client) GetComment ¶
func (*Client) GetComments ¶
func (*Client) GetCommentsPage ¶
func (*Client) GetFollowers ¶
func (*Client) GetFollowing ¶
func (*Client) GetFollowingFeed ¶
func (c *Client) GetFollowingFeed(ctx context.Context, nextURL string, limit int) (map[string]any, error)
GetFollowingFeed returns one page from the feed made up of activity from people, questions, topics, and columns the current user follows. Pass the paging.next URL from the previous response to load another page.
func (*Client) GetHotList ¶
func (*Client) GetNotifications ¶
func (*Client) GetQuestion ¶
func (*Client) GetQuestionAnswers ¶
func (*Client) GetSelfInfo ¶
func (*Client) GetUserAnswers ¶
func (*Client) GetUserArticles ¶
func (*Client) GetUserProfile ¶
func (*Client) LikeComment ¶
func (*Client) MarkAllNotificationsRead ¶
func (*Client) MarkNotificationsRead ¶
func (*Client) ReplyComment ¶
func (*Client) ReplyCommentToResource ¶
func (*Client) SetContentVote ¶
func (*Client) UnfollowQuestion ¶
func (*Client) UnlikeComment ¶
func (*Client) UploadImage ¶
func (*Client) VoteNeutral ¶
type DataFetchError ¶
func (DataFetchError) Error ¶
func (e DataFetchError) Error() string
type Endpoints ¶
type Endpoints struct {
APIV4 string
APIV3 string
ZhuanlanAPI string
ImageAPI string
OSSUploadURL string
ContentPublishURL string
ContentDraftsURL string
}
func DefaultEndpoints ¶
func DefaultEndpoints() Endpoints
type LoginError ¶
type LoginError struct {
Message string
}
func (LoginError) Error ¶
func (e LoginError) Error() string
Click to show internal directories.
Click to hide internal directories.