Documentation ¶
Index ¶
- Variables
- func IsFailedToThumbnailingErr(resp *http.Response) (bool, error)
- type Block
- type Client
- type Creator
- type CreatorIDLister
- type CreatorIDListerDoInput
- type CreatorListFollowingResponse
- type Downloadable
- type File
- type Image
- type ListCreatorResponse
- type LocalStorage
- type OfficialAPIClient
- type Pagination
- type Plan
- type PlanListSupportingResponse
- type Post
- type PostBody
- type PostInfoResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFailedToThumbnailing = fmt.Errorf("failed to thumbnailing")
View Source
var ErrStatusForbidden = errors.New("status code 403")
Functions ¶
Types ¶
type Client ¶
type Client struct { CheckAllPosts bool DryRun bool SkipFiles bool SkipImages bool SkipOnError bool OfficialAPIClient *OfficialAPIClient Storage *LocalStorage }
Client is the struct for Client.
type CreatorIDLister ¶ added in v0.15.0
type CreatorIDLister struct {
OfficialAPIClient *OfficialAPIClient
}
func (*CreatorIDLister) Do ¶ added in v0.15.0
func (c *CreatorIDLister) Do(ctx context.Context, in *CreatorIDListerDoInput) ([]string, error)
type CreatorIDListerDoInput ¶ added in v0.15.0
type CreatorListFollowingResponse ¶ added in v0.15.0
type CreatorListFollowingResponse struct {
Body []Creator `json:"body"`
}
type Downloadable ¶ added in v0.15.0
type File ¶ added in v0.12.0
type File struct { ID string `json:"id"` Name string `json:"name"` Extension string `json:"extension"` URL string `json:"url"` }
File represents a uploaded file.
func (File) GetExtension ¶ added in v0.15.0
func (File) GetThumbnailURL ¶ added in v0.25.0
type Image ¶
type Image struct { ID string `json:"id"` Extension string `json:"extension"` OriginalURL string `json:"originalUrl"` ThumbnailURL string `json:"thumbnailUrl"` }
Image represents a uploaded image.
func (Image) GetExtension ¶ added in v0.15.0
func (Image) GetThumbnailURL ¶ added in v0.25.0
type ListCreatorResponse ¶ added in v0.15.0
type ListCreatorResponse struct {
Body []Post `json:"body"`
}
ListCreatorResponse represents the response of https://api.fanbox.cc/post.listCreator.
type LocalStorage ¶ added in v0.15.0
type LocalStorage struct { SaveDir string DirByPost bool DirByPlan bool RemoveUnprintableChars bool }
func (*LocalStorage) Exist ¶ added in v0.15.0
func (s *LocalStorage) Exist(post Post, order int, d Downloadable) (bool, error)
func (*LocalStorage) Save ¶ added in v0.15.0
func (s *LocalStorage) Save(post Post, order int, d Downloadable, r io.Reader) error
type OfficialAPIClient ¶ added in v0.15.0
func (*OfficialAPIClient) RequestAndUnwrapJSON ¶ added in v0.15.0
type Pagination ¶ added in v0.23.0
type Pagination struct {
Pages []string `json:"body"`
}
Pagination represents the response of https://api.fanbox.cc/post.paginateCreator?creatorId=x.
type PlanListSupportingResponse ¶ added in v0.15.0
type PlanListSupportingResponse struct {
Body []Plan `json:"body"`
}
type Post ¶
type Post struct { ID string `json:"id"` Title string `json:"title"` PublishedDateTime string `json:"publishedDatetime"` CreatorID string `json:"creatorId"` FeeRequired int `json:"feeRequired"` IsRestricted bool `json:"isRestricted"` IsPinned bool `json:"isPinned"` Body *PostBody `json:"body"` }
Post represents post attributes.
func (*Post) ListDownloadable ¶ added in v0.15.0
func (f *Post) ListDownloadable() []Downloadable
type PostBody ¶
type PostBody struct { // Files is not nil if post type is "file". Files *[]File `json:"files"` // Images is not nil if post type is "image". Images *[]Image `json:"images"` // Blocks is not nil if post type is "blog". Blocks *[]Block `json:"blocks"` // ImageMap is not nil if post type is "blog". ImageMap *map[string]Image `json:"imageMap"` // FileMap is not nil if post type is "blog". FileMap *map[string]File `json:"fileMap"` }
type PostInfoResponse ¶ added in v0.15.0
type PostInfoResponse struct {
Body Post `json:"body"`
}
PostInfoResponse represents the response of https://api.fanbox.cc/post.info.
Click to show internal directories.
Click to hide internal directories.