Documentation
¶
Index ¶
- Variables
- func GetPostID(url string) string
- func Init()
- type Danbooru
- func (d *Danbooru) FetchNewArtworks(ctx context.Context, limit int) ([]*dto.FetchedArtwork, error)
- func (d *Danbooru) GetArtworkInfo(ctx context.Context, sourceURL string) (*dto.FetchedArtwork, error)
- func (d *Danbooru) MatchesSourceURL(text string) (string, bool)
- func (d *Danbooru) PrettyFileName(artwork shared.ArtworkLike, picture shared.PictureLike) string
- type DanbooruFailJsonResp
- type DanbooruJsonResp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidDanbooruPostURL = errors.New("invalid danbooru post url") ErrDanbooruNoImage = errors.New("danbooru post has no image") )
Functions ¶
Types ¶
type Danbooru ¶
type Danbooru struct {
// contains filtered or unexported fields
}
func (*Danbooru) FetchNewArtworks ¶
func (*Danbooru) GetArtworkInfo ¶
func (*Danbooru) PrettyFileName ¶
func (d *Danbooru) PrettyFileName(artwork shared.ArtworkLike, picture shared.PictureLike) string
PrettyFileName implements source.ArtworkSource.
type DanbooruFailJsonResp ¶
type DanbooruJsonResp ¶
type DanbooruJsonResp struct {
DanbooruFailJsonResp
TagString string `json:"tag_string"`
FileURL string `json:"file_url"`
LargeFileURL string `json:"large_file_url"`
ID int `json:"id"`
ImageWidth int `json:"image_width"`
ImageHeight int `json:"image_height"`
}
func (*DanbooruJsonResp) ToArtwork ¶
func (resp *DanbooruJsonResp) ToArtwork() (*dto.FetchedArtwork, error)
Click to show internal directories.
Click to hide internal directories.