Documentation
¶
Index ¶
Constants ¶
View Source
const ( //ServerKonachan Host ServerKonachan = "https://konachan.com/" //ServerYandere Host ServerYandere = "https://yande.re/" //ServerGelbooru Host ServerGelbooru = "https://gelbooru.com/" //ServerRule34 Host ServerRule34 = "https://rule34.xxx/" //ServerSafebooru Host ServerSafebooru = "https://safebooru.org/" //ServerTBIB Host ServerTBIB = "https://tbib.org/" //ServerSankaku Host ServerSankaku = "https://capi-beta.sankakucomplex.com/" )
View Source
const ( //RatingSafe PG RatingSafe = "safe" //RatingQuestionablePG +16 Not supported by every server RatingQuestionablePG = "questionableless" //RatingQuestionable +16 RatingQuestionable = "questionable" //RatingQuestionableExplicit +16 && +18 Not supported by every server RatingQuestionableExplicit = "questionableplus" //RatingExplicit +18 RatingExplicit = "explicit" )
View Source
const ( //ErrNoResults No results found ErrNoResults = 1 //ErrEmpty No answer from server ErrEmpty = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostRequest ¶
type PostRequest struct { Tags []string ExcludedTags []string BeforeID int64 AfterID int64 RandOrder bool Rating string Height int Width int MaxResults int TargetAPI string // contains filtered or unexported fields }
PostRequest store data prepare the api querry
func (*PostRequest) APIrequest ¶
func (c *PostRequest) APIrequest() string
APIrequest parse PostRequest to get the equivalent api query url
func (*PostRequest) GetResults ¶
func (c *PostRequest) GetResults() ([]PostResult, error)
GetResults runs the query obtained at APIrequest and returns PostResult
type PostResult ¶
type PostResult struct { ID int64 `json:"id"` Tags string `json:"tags"` Author string `json:"author"` Source string `json:"source"` Score int64 `json:"score"` Md5 string `json:"md5"` FileSize int64 `json:"file_size"` FileURL string `json:"file_url"` Rating string `json:"rating"` Width int64 `json:"width"` Height int64 `json:"height"` PostURL string }
PostResult has useful data obtained from the API
func (*PostResult) RatingString ¶
func (c *PostResult) RatingString() string
RatingString Returns the human-readable sting for rating values
Click to show internal directories.
Click to hide internal directories.