Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleBody ¶
type ArticleBody struct { Blocks []struct { Type string `json:"type"` Text string `json:"text,omitempty"` ImageID string `json:"imageId,omitempty"` } `json:"blocks"` ImageMap map[string]PostImage `json:"imageMap"` }
func (*ArticleBody) ToPostImages ¶
func (body *ArticleBody) ToPostImages(log logrus.FieldLogger) []PostImage
type Client ¶
type Client struct { // Token from cookie key FANBOXSESSID Token string // contains filtered or unexported fields }
func (*Client) HTTPClient ¶
HTTPClient returns a non-nil http client pointer.
If the field `httpClient` is not nil, this will return that field. Otherwise, this function will initialize a new http client and store it to `httpClient` field. Then return the client.
The return http client will populate headers (user agent, referrer, etc) and cookies (authentication token) automatically.
func (*Client) ListCreatorPost ¶
ListCreatorPost fetch all posts from the given creator ID
func (*Client) ListImages ¶ added in v1.1.0
func (c *Client) ListImages(ctx context.Context, log logrus.FieldLogger, post *Post) ([]PostImage, error)
ListImages lists the images found in this post
type FileBody ¶
type FileBody struct{}
func (*FileBody) ToPostImages ¶
func (body *FileBody) ToPostImages(log logrus.FieldLogger) []PostImage
type ImageBody ¶
func (*ImageBody) ToPostImages ¶
func (body *ImageBody) ToPostImages(log logrus.FieldLogger) []PostImage
type ListCreatorPostResponse ¶
type ListCreatorPostResponse struct { Body struct { Items []struct { ID string `json:"id"` Title string `json:"title"` CoverImageURL string `json:"coverImageUrl"` FeeRequired int `json:"feeRequired"` PublishedDatetime time.Time `json:"publishedDatetime"` UpdatedDatetime time.Time `json:"updatedDatetime"` IsRestricted bool `json:"isRestricted"` CreatorID string `json:"creatorId"` HasAdultContent bool `json:"hasAdultContent"` } `json:"items"` NextURL string `json:"nextUrl,omitempty"` } `json:"body"` }
type PostBody ¶
type PostBody interface {
ToPostImages(log logrus.FieldLogger) []PostImage
}
type PostInfoResponse ¶ added in v1.1.0
type PostInfoResponse struct { Body struct { ID string `json:"id"` Title string `json:"title"` CoverImageURL string `json:"coverImageUrl"` FeeRequired int `json:"feeRequired"` PublishedDatetime time.Time `json:"publishedDatetime"` UpdatedDatetime time.Time `json:"updatedDatetime"` Type string `json:"type"` Body *json.RawMessage `json:"body"` Excerpt string `json:"excerpt"` IsRestricted bool `json:"isRestricted"` CreatorID string `json:"creatorId"` HasAdultContent bool `json:"hasAdultContent"` } `json:"body"` }
type TextBody ¶
type TextBody struct {
Text string `json:"text"`
}
func (*TextBody) ToPostImages ¶
func (body *TextBody) ToPostImages(log logrus.FieldLogger) []PostImage
Click to show internal directories.
Click to hide internal directories.