Documentation
¶
Index ¶
Constants ¶
const FetcherCount = 4
Number of parallel fetch workers
Variables ¶
This section is empty.
Functions ¶
func GelbooruFetchPage ¶
func GelbooruFetchPage(query string, json bool, page, limit uint) ( body io.ReadCloser, err error, )
Makes request to a gelbooru page with selected tag query
Types ¶
type ErrUnknownRating ¶
type ErrUnknownRating []byte
func (ErrUnknownRating) Error ¶
func (e ErrUnknownRating) Error() string
type Post ¶
type Post interface {
// Return explicitness rating
Rating() (Rating, error)
// Return MD5 hash
MD5() ([16]byte, error)
// Return source file URL
FileURL() string
// Return sample file image URL or source file URL, if no sample present
SampleURL() string
// Return source URL, if any
SourceURL() string
// Return source file width
Width() uint64
// Return source file height
Height() uint64
// Return tags applied to post
Tags() ([]Tag, error)
// Return last modification date
UpdatedOn() (time.Time, error)
// Return post creation date
CreatedOn() (time.Time, error)
}
Single booru image post. Fields are lazily fetched and/or converted on demand for optimization purposes.
func DanbooruByMD5 ¶
Fetch a single danbooru post by MD5. If no match found, Post will be nil.
func FromDanbooru ¶
Fetch posts from Danbooru for the given tag query. Note the query may only contain up to 2 tags. Fetches are limited to a maximum of FetcherCount concurrent requests to prevent antispam measures by the boorus.
func FromGelbooru ¶
Fetch posts from Gelbooru for the given tag query. If the source of the image is Danbooru, a more up-to-date set of tags is fetched from there. Fetches are limited to a maximum of FetcherCount concurrent requests to prevent antispam measures by the boorus.
type Rating ¶
type Rating uint8
Explicitness rating of post