Documentation
¶
Index ¶
- Variables
- type Agent
- type Chapter
- type ChapterPartial
- type Demographic
- type Follows
- type Genre
- type Group
- type GroupPartial
- type GroupSearch
- type Home
- type Language
- type ListingOrder
- type Manga
- type MangaExternalLink
- type MangaPartial
- type MangaRelated
- type MangaSearch
- type MangaSearchQuery
- type Origin
- type PublishStatus
- type TagExclusionMode
- type TagInclusionMode
- type UploadRestriction
- type User
- type UserPartial
Constants ¶
This section is empty.
Variables ¶
var BaseURL = "https://mangadex.org"
BaseURL host base url.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
Agent represents user and session information.
func (*Agent) LoadSession ¶
LoadSession loads session from a file. It returns errNoSessionCache when the specified sessionPath doesn't exists.
func (*Agent) Login ¶
Login logins to mangadex and retrieves SessionID and PersistentID. It returns errIncorrectUsernameOrPassword when the specified username or password is invalid.
func (*Agent) SaveSession ¶
SaveSession saves session to a file. It returns errEmptySessionID when SessionID is empty.
func (*Agent) ValidateSession ¶
ValidateSession validates an existing SessionID. It returns errEmptySessionID when SessionID is empty, and returns errInvalidOrExpireSession when SessionID is invalid or expired.
type Chapter ¶
type Chapter struct {
ID,
Chapter,
Comments,
MangaID,
Volume,
Timestamp int
Title,
Language,
Hash,
Server string
Pages []string
Groups []GroupPartial
}
Chapter represents full information of a chapter.
func GetChapter ¶
GetChapter retrieves all available information and pages of a chapter by its ID.
type ChapterPartial ¶
type ChapterPartial struct {
ID,
Chapter,
Volume,
Timestamp int
Title,
Language string
Groups []GroupPartial
}
ChapterPartial represents partial information of a chapter.
type Demographic ¶
type Demographic int
const ( DemographicShounen Demographic = 1 + iota DemographicShoujo DemographicSeinen DemographicJosei )
type Follows ¶
type Follows struct {
Manga []MangaPartial
CurrentPage,
ResultsCount int
// contains filtered or unexported fields
}
func GetFollows ¶
GetFollows retrieves all available followed manga
type Genre ¶
type Genre int
const ( Genre4Koma Genre = 1 GenreAction Genre = 2 GenreAdventure Genre = 3 GenreAwardWinning Genre = 4 GenreComedy Genre = 5 GenreCooking Genre = 6 GenreDoujinshi Genre = 7 GenreDrama Genre = 8 GenreEcchi Genre = 9 GenreFantasy Genre = 10 GenreGyaru Genre = 11 GenreHarem Genre = 12 GenreHistorical Genre = 13 GenreHorror Genre = 14 GenreMartialArts Genre = 16 GenreMecha Genre = 17 GenreMedical Genre = 18 GenreMusic Genre = 19 GenreMystery Genre = 20 GenreOneshot Genre = 21 GenrePsychological Genre = 22 GenreRomance Genre = 23 GenreSchoolLife Genre = 24 GenreSciFi Genre = 25 GenreShoujoAi Genre = 28 GenreShounenAi Genre = 30 GenreSliceofLife Genre = 31 GenreSmut Genre = 32 GenreSports Genre = 33 GenreSupernatural Genre = 34 GenreTragedy Genre = 35 GenreLongStrip Genre = 36 GenreYaoi Genre = 37 GenreYuri Genre = 38 GenreVideoGames Genre = 40 GenreIsekai Genre = 41 GenreAdaptation Genre = 42 GenreAnthology Genre = 43 GenreWebComic Genre = 44 GenreFullColor Genre = 45 GenreUserCreated Genre = 46 GenreOfficialColored Genre = 47 GenreFanColored Genre = 48 GenreGore Genre = 49 GenreSexualViolence Genre = 50 GenreCrime Genre = 51 GenreMagicalGirls Genre = 52 GenrePhilosophical Genre = 53 GenreSuperhero Genre = 54 GenreThriller Genre = 55 GenreWuxia Genre = 56 GenreAliens Genre = 57 GenreAnimals Genre = 58 GenreCrossdressing Genre = 59 GenreDemons Genre = 60 GenreDelinquents Genre = 61 GenreGenderswap Genre = 62 GenreGhosts Genre = 63 GenreMonsterGirls Genre = 64 GenreLoli Genre = 65 GenreMagic Genre = 66 GenreMilitary Genre = 67 GenreMonsters Genre = 68 GenreNinja Genre = 69 GenreOfficeWorkers Genre = 70 GenrePolice Genre = 71 GenrePostApocalyptic Genre = 72 GenreReincarnation Genre = 73 GenreReverseHarem Genre = 74 GenreSamurai Genre = 75 GenreShota Genre = 76 GenreSurvival Genre = 77 GenreTimeTravel Genre = 78 GenreVampires Genre = 79 GenreTraditionalGames Genre = 80 GenreVirtualReality Genre = 81 GenreZombies Genre = 82 GenreIncest Genre = 83 )
type Group ¶
type Group struct {
ID,
LikeCount int
Name,
AlternativeName,
Cover,
Language,
Description,
RSS string
Statistics struct {
Views,
Follows,
Chapters,
Comments int
}
Links []string
Leader UserPartial
Members []UserPartial
UploadRestriction UploadRestriction
Delay string
}
Group represents full information of a group.
type GroupPartial ¶
GroupPartial represents partial information of a group.
type GroupSearch ¶
type GroupSearch struct {
Groups []GroupPartial
CurrentPage,
ResultsCount int
// contains filtered or unexported fields
}
GroupSearch represents search information and partial information of all available groups.
func SearchGroup ¶
func SearchGroup(name string) (*GroupSearch, error)
SearchGroup retrieves group(s) by name.
func (*GroupSearch) Next ¶
func (s *GroupSearch) Next() (*GroupSearch, error)
Next retrieves next page of search result. It returns nil when next page is unavailable.
type Home ¶
type Home struct {
Latest,
Follows,
Top6H,
Top24H,
Top7D,
TopFollows,
TopRating []MangaPartial
}
Home represents all available manga (Latest, Follows, Top Chapters, Top Manga) on the homepage.
type Language ¶
type Language string
const ( LanguageArabic Language = "SA" LanguageBengali Language = "BD" LanguageBulgarian Language = "BG" LanguageBurmese Language = "MM" LanguageCatalan Language = "CT" LanguageChineseSimp Language = "CN" LanguageChineseTrad Language = "HK" LanguageCzech Language = "CZ" LanguageDanish Language = "DK" LanguageDutch Language = "NL" LanguageEnglish Language = "GB" LanguageFilipino Language = "PH" LanguageFinnish Language = "FI" LanguageFrench Language = "FR" LanguageGerman Language = "DE" LanguageGreek Language = "GR" LanguageHungarian Language = "HU" LanguageIndonesian Language = "ID" LanguageItalian Language = "IT" LanguageJapanese Language = "JP" LanguageKorean Language = "KR" LanguageLithuanian Language = "LT" LanguageMalay Language = "MY" LanguageMongolian Language = "MN" LanguagePersian Language = "IR" LanguagePolish Language = "PL" LanguagePortugueseBR Language = "BR" LanguagePortuguesePT Language = "PT" LanguageRomanian Language = "RO" LanguageRussian Language = "RU" LanguageSerboCroatian Language = "RS" LanguageSpanishEs Language = "ES" LanguageSpanishLATAM Language = "MX" LanguageSwedish Language = "SE" LanguageThai Language = "TH" LanguageTurkish Language = "TR" LanguageUkrainian Language = "UA" LanguageVietnamese Language = "VN" )
type ListingOrder ¶
type ListingOrder int
const ( ListingOrderLastUpdatedAsc ListingOrder = iota ListingOrderLastUpdatedDesc ListingOrderTitleAsc ListingOrderTitleDesc ListingOrderCommentsAsc ListingOrderCommentsDesc ListingOrderRatingAsc ListingOrderRatingDesc ListingOrderViewsAsc ListingOrderViewsDesc ListingOrderFollowsAsc ListingOrderFollowsDesc )
type Manga ¶
type Manga struct {
ID int
Title,
Origin,
Cover string
AlternativeTitles,
Authors,
Artists,
Demographics,
Contents,
Formats,
Genres,
Themes []string
Hentai bool
Rating struct {
Bayesian float32
Mean float32
Users int
}
Status string
Statistics struct {
Views,
Follows,
Chapters,
Comments int
}
Description string
Related []MangaRelated
OfficialLinks,
RetailLinks,
InformationLinks []MangaExternalLink
Chapters []ChapterPartial
// contains filtered or unexported fields
}
Manga represents full information and all available chapters of a manga.
type MangaExternalLink ¶
type MangaExternalLink struct {
Name,
URL string
}
MangaExternalLink represents information of external link.
type MangaPartial ¶
MangaPartial represents partial information of a manga.
func GetFeatured ¶
func GetFeatured() ([]MangaPartial, error)
Retrieves all available featured manga
type MangaRelated ¶
MangaRelated represents information of related manga.
type MangaSearch ¶
type MangaSearch struct {
Manga []MangaPartial
CurrentPage,
ResultsCount int
// contains filtered or unexported fields
}
MangaSearch represents search information and partial information of all available manga.
func SearchManga ¶
func SearchManga(a *Agent, q *MangaSearchQuery) (*MangaSearch, error)
SearchManga retrieves manga(s) by query.
func (*MangaSearch) Next ¶
func (s *MangaSearch) Next() (*MangaSearch, error)
Next retrieves next page of search result. It returns nil when next page is unavailable.
type MangaSearchQuery ¶
type MangaSearchQuery struct {
Title,
Author,
Artist string
Origin Origin
Demographics []Demographic
PublishStatuses []PublishStatus
ExcludeTags []Genre
IncludeTags []Genre
TagExclusionMode TagExclusionMode
TagInclusionMode TagInclusionMode
ListingOrder ListingOrder
}
MangaSearchQuery represents search queries.
type Origin ¶
type Origin int
const ( OriginEnglish Origin = 1 OriginJapanese Origin = 2 OriginPolish Origin = 3 OriginGerman Origin = 8 OriginFrench Origin = 10 OriginVietnamese Origin = 12 OriginChinese Origin = 21 OriginIndonesian Origin = 27 OriginKorean Origin = 28 OriginSpanishLATAM Origin = 29 OriginThai Origin = 32 OriginPhilippines Origin = 34 OriginHongkong Origin = 35 )
type PublishStatus ¶
type PublishStatus int
const ( PublishStatusOngoing PublishStatus = 1 + iota PublishStatusCompleted PublishStatusCancelled PublishStatusHiatus )
type TagExclusionMode ¶
type TagExclusionMode int
const ( TagExclusionModeAny TagExclusionMode = iota TagExclusionModeAll )
type TagInclusionMode ¶
type TagInclusionMode int
const ( TagInclusionModeAll TagInclusionMode = iota TagInclusionModeAny )
type UploadRestriction ¶
type UploadRestriction string
const ( UploadRestrictionMembersOnly UploadRestriction = "members" UploadRestrictionAll UploadRestriction = "everyone" )
type UserPartial ¶
UserPartial represents partial information of a user.