Documentation
¶
Overview ¶
Package mobileapi handles the default API functionality reverse engineered from the mobile application since the API is not documented or intended to be used outside of the mobile application
Index ¶
- Constants
- type IllustDetail
- type Illustration
- type MobileAPI
- func (a *MobileAPI) GetIllustDetail(illustID int) (*IllustDetail, error)
- func (a *MobileAPI) GetSearchIllust(word string, searchMode string, searchOrder string, offset int) (*SearchIllust, error)
- func (a *MobileAPI) GetSearchIllustByURL(url string) (*SearchIllust, error)
- func (a *MobileAPI) GetUgoiraMetadata(illustID int) (*UgoiraMetadata, error)
- func (a *MobileAPI) GetUserDetail(userID int) (*UserDetail, error)
- func (a *MobileAPI) GetUserIllusts(userID int, filter string, offset int) (*UserIllusts, error)
- func (a *MobileAPI) GetUserIllustsByURL(url string) (*UserIllusts, error)
- type SearchIllust
- type UgoiraFrame
- type UgoiraMetadata
- type UserDetail
- type UserIllusts
- type UserInfo
Constants ¶
const ( // order of the search results SearchOrderDateAscending = "date_asc" SearchOrderDateDescending = "date_desc" SearchOrderPopularityAscending = "popular_asc" SearchOrderPopularityDescending = "popular_desc" // search modes SearchModePartialTagMatch = "partial_match_for_tags" SearchModeExactTagMatch = "exact_match_for_tags" SearchModeTitleAndCaption = "title_and_caption" )
noinspection GoUnusedConst
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IllustDetail ¶
type IllustDetail struct {
Illustration Illustration `json:"illust"`
}
IllustDetail contains all relevant information regarding an illustration detail API request
type Illustration ¶
type Illustration struct {
ID int `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
MetaSinglePage struct {
OriginalImageURL *string `json:"original_image_url"`
} `json:"meta_single_page"`
MetaPages []*struct {
ImageURLs struct {
Original string `json:"original"`
} `json:"image_urls"`
} `json:"meta_pages"`
User UserInfo `json:"user"`
}
Illustration contains all relevant information of an illustration
type MobileAPI ¶
MobileAPI is the implementation of the API used in the mobile applications
func NewMobileAPI ¶
NewMobileAPI initializes the mobile API and handles the whole OAuth2 and round tripper procedures
func (*MobileAPI) GetIllustDetail ¶
func (a *MobileAPI) GetIllustDetail(illustID int) (*IllustDetail, error)
GetIllustDetail returns the illustration details from the API
func (*MobileAPI) GetSearchIllust ¶
func (a *MobileAPI) GetSearchIllust( word string, searchMode string, searchOrder string, offset int, ) (*SearchIllust, error)
GetSearchIllust returns the illustration search results from the API
func (*MobileAPI) GetSearchIllustByURL ¶
func (a *MobileAPI) GetSearchIllustByURL(url string) (*SearchIllust, error)
GetSearchIllustByURL returns the illustration search results from the API by passed URL
func (*MobileAPI) GetUgoiraMetadata ¶
func (a *MobileAPI) GetUgoiraMetadata(illustID int) (*UgoiraMetadata, error)
GetUgoiraMetadata returns the animation details from the API
func (*MobileAPI) GetUserDetail ¶
func (a *MobileAPI) GetUserDetail(userID int) (*UserDetail, error)
GetUserDetail returns the user details from the API
func (*MobileAPI) GetUserIllusts ¶
GetUserIllusts returns the user illustration results from the API
func (*MobileAPI) GetUserIllustsByURL ¶
func (a *MobileAPI) GetUserIllustsByURL(url string) (*UserIllusts, error)
GetUserIllustsByURL returns the user illustration results from the API by passed URL
type SearchIllust ¶
type SearchIllust struct {
Illustrations []Illustration `json:"illusts"`
NextURL string `json:"next_url"`
}
SearchIllust contains all relevant information regarding the illustration search
type UgoiraFrame ¶
UgoiraFrame contains all available information of the animation frames
type UgoiraMetadata ¶
type UgoiraMetadata struct {
Metadata struct {
ZipURLs struct {
Medium string `json:"medium"`
} `json:"zip_urls"`
Frames []*UgoiraFrame `json:"frames"`
} `json:"ugoira_metadata"`
}
UgoiraMetadata contains all relevant information regarding the animation details (ugoira)
func (*UgoiraMetadata) GetUgoiraFrame ¶
func (m *UgoiraMetadata) GetUgoiraFrame(fileName string) (*UgoiraFrame, error)
GetUgoiraFrame returns the associated UgoiraFrame information if existent
type UserDetail ¶
type UserDetail struct {
User UserInfo `json:"user"`
Profile struct {
Website string `json:"webpage"`
TotalIllustrations int `json:"total_illusts"`
TotalManga int `json:"total_manga"`
TotalNovels int `json:"total_novels"`
} `json:"profile"`
}
UserDetail contains all relevant information regarding the user details
type UserIllusts ¶
type UserIllusts struct {
Illustrations []Illustration `json:"illusts"`
NextURL string `json:"next_url"`
}
UserIllusts contains all relevant information regarding the user illustrations and navigation