Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //ErrLongLimitReached is an error returned by SauceNAO when daily limit has been reached. ErrLongLimitReached = errors.New("24 hours rate limit reached") //ErrShortLimitReached is an error returned by SauceNAO when 30 seconds limit has been reached. ErrShortLimitReached = errors.New("30 seconds rate limit reached") //ErrRateLimitReached is a genenal rate limit error if unable to decide which limit has been reached. ErrRateLimitReached = errors.New("Rate limit reached") //ErrInvalidAPIKey is an error thrown when provided API key is incorrect. Either when status code is 403 or user_id header equals 0 ErrInvalidAPIKey = errors.New("Invalid API key") //ErrFileTooLarge is an error thrown when SauceNAO returns 413 ErrFileTooLarge = errors.New("File is too large") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is a SauceNAO API call configuration structure.
APIKEy is an API token used on requests.
DB searches a specific database index without having to generate a mask.
TestMode causes each index that has a match for the given image to output at most 1 result. Useful for testing some things.
Results controls how many results are returned from SauceNAO.
IncludeMask is an array of the only database indices you want returned from SauceNAO. A mask of [5] would only return results from Pixiv.
ExcludeMask is an opposite of IncludeMask, a mask of [5] would return results from anywhere but Pixiv.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns default Config configuration.
type DB ¶
type DB int
const ( HMagazines DB = 0 HGameCG DB = 2 DoujinshiDB DB = 3 Pixiv DB = 5 PixivHistorical DB = 6 NicoNicoSeiga DB = 8 Danbooru DB = 9 Drawr DB = 10 Nijie DB = 11 Yandere DB = 12 Openingsmoe DB = 13 Shutterstock DB = 15 FAKKU DB = 16 HMisc DB = 18 TwoDMarket DB = 19 MediBang DB = 20 Anime DB = 21 HAnime DB = 22 Movies DB = 23 Shows DB = 24 Gelbooru DB = 25 Konachan DB = 26 SankakuChannel DB = 27 AnimePicturesnet DB = 28 E621net DB = 29 IdolComplex DB = 30 BcynetIllust DB = 31 BcynetCosplay DB = 32 PortalGraphicsnet DB = 33 DeviantArt DB = 34 Pawoonet DB = 35 Madokami DB = 36 MangaDex DB = 37 HMiscEHentai DB = 38 Artstation DB = 39 FurAffinity DB = 40 All DB = 999 )
type Result ¶
type Result struct { Data *ResultData `json:"data,omitempty"` Header *ResultHeader `json:"header,omitempty"` }
type ResultData ¶
type ResultData struct { ExternalURLs []string `json:"ext_urls,omitempty"` Title string `json:"title,omitempty"` DaID interface{} `json:"da_id,omitempty"` Author string `json:"author,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorURL string `json:"author_url,omitempty"` AnidbAid interface{} `json:"anidb_aid,omitempty"` Artist string `json:"artist,omitempty"` BcyID interface{} `json:"bcy_id,omitempty"` BcyType string `json:"bcy_type,omitempty"` DanbooruID interface{} `json:"danbooru_id,omitempty"` DdbID interface{} `json:"ddb_id,omitempty"` DrawrID interface{} `json:"drawr_id,omitempty"` Creator interface{} `json:"creator,omitempty"` EngName string `json:"eng_name,omitempty"` E621ID interface{} `json:"e621_id,omitempty"` File string `json:"file,omitempty"` GelbooruID interface{} `json:"gelbooru_id,omitempty"` IdolID interface{} `json:"idol_id,omitempty"` ImdbID interface{} `json:"imdb_id,omitempty"` JpName string `json:"jp_name,omitempty"` KonachanID interface{} `json:"konachan_id,omitempty"` Material string `json:"material,omitempty"` MemberLinkID interface{} `json:"member_link_id,omitempty"` MuID interface{} `json:"mu_id,omitempty"` NijieID interface{} `json:"nijie_id,omitempty"` Part string `json:"part,omitempty"` PawooID interface{} `json:"pawoo_id,omitempty"` PgID interface{} `json:"pg_id,omitempty"` PixivID interface{} `json:"pixiv_id,omitempty"` SankakuID interface{} `json:"sankaku_id,omitempty"` SeigaID interface{} `json:"seiga_id,omitempty"` Source string `json:"source,omitempty"` URL string `json:"url,omitempty"` UserAcct string `json:"user_acct,omitempty"` YandereID interface{} `json:"yandere_id,omitempty"` MemberID interface{} `json:"member_id,omitempty"` MemberName string `json:"member_name,omitempty"` }
type ResultHeader ¶
type Sauce ¶
type Sauce struct { Title string Thumbnail string Similarity float64 Author *SauceAuthor URLs *SauceURLs Pretty bool Raw *Result }
Sauce is an abstaction over SauceNAO response. If Pretty is false, then all fields except Raw are default.
type SauceAuthor ¶
SauceAuthor contains information about art's author