Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CastRelationship ¶
func CastRelationship[T any](rel *Relationship) (out T, err error)
CastRelationship is a special helper function that uses JSON marshaling to transform a Relationship's attributes into another type.
This function should be used with care.
Types ¶
type Chapter ¶
type Chapter struct {
ID uuid.UUID `json:"id"`
Attributes ChapterAttributes `json:"attributes"`
Relationships []Relationship `json:"relationships"`
// contains filtered or unexported fields
}
Chapter is a single chapter on MangaDex. Use FetchChapter to get one from the API.
func FetchChapter ¶
func FetchChapter( ctx context.Context, id uuid.UUID, queryParams url.Values, ) (c Chapter, err error)
Fetch gets the chapter information the MangaDex API and returns the Chapter.
func (*Chapter) FetchImageURLs ¶
FetchImageURLs gets the list of image URLs that correspond to this Chapter. These URLs are not part of the normal MangaDex API, and are usually fetched from the Mangadex@Home servers via mangadex.network. This function uses the DataSaver and MDUploads global options
See also: https://api.mangadex.org/docs/04-chapter/retrieving-chapter/
func (*Chapter) FullTitle ¶
FullTitle builds and returns the full title of the chapter including the manga name, volume number, chapter number, and chapter title. This value is cached on the Chapter struct.
type ChapterAttributes ¶
type ChapterAttributes struct {
Title string `json:"title"`
Volume string `json:"volume"`
Chapter string `json:"chapter"`
Pages int `json:"pages"`
TranslatedLanguage string `json:"translatedLanguage"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
ChapterAttributes are all the field attributes for a chapter.
type Data ¶
type Data[T any] struct { Result string `json:"result"` Data T `json:"data"` Limit int `json:"limit"` Offset int `json:"offset"` }
Data is a wrapping type that is used to parse most responses from the MangaDex API
type Manga ¶
type Manga struct {
ID uuid.UUID `json:"id"`
Attributes MangaAttributes `json:"attributes"`
Relationships []Relationship `json:"relationships"`
// contains filtered or unexported fields
}
Manga is a single manga/comic series on MangaDex. Use FetchManga to get one from the API.
func FetchManga ¶
FetchManga gets the manga series information the MangaDex API and returns the Manga.
func SearchManga ¶
SearchManga queries the MangaDex search endpoint and returns an array of Manga.
func (*Manga) Feed ¶
Feed returns the chapter feed for a series as an array of Chapter. By default the it filters to the current language in shared.GlobalOptions and sorts the chapters in ascending order, filtering out empty chapters. This can be changed using the queryParams.
func (*Manga) RelData ¶
RelData returns the RelData for this manga. This value is cached on the Manga struct.
type MangaAttributes ¶
type MangaAttributes struct {
Title map[string]string `json:"title"`
AltTitles []map[string]string `json:"altTitles"`
Description map[string]string `json:"description"`
OriginalLanguage string `json:"originalLanguage"`
Status string `json:"status"`
Demographic string `json:"publicationDemographic"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
MangaAttributes are all the field attributes for a manga.
type RelData ¶
RelData is the parsed Relationship data for a Manga.