Documentation
¶
Index ¶
- type Chapter
- type ChapterInfo
- type ChapterWithComicInfoXML
- type Manga
- type MangaInfo
- type MangaWithSeriesJSON
- type Metadata
- func (m *Metadata) AlternateTitles() []string
- func (m *Metadata) Artists() []string
- func (m *Metadata) Authors() []string
- func (m *Metadata) Banner() string
- func (m *Metadata) Chapters() int
- func (m *Metadata) Characters() []string
- func (m *Metadata) Country() string
- func (m *Metadata) Cover() string
- func (m *Metadata) Description() string
- func (m *Metadata) EndDate() metadata.Date
- func (m *Metadata) ExtraIDs() []metadata.ID
- func (m *Metadata) Format() string
- func (m *Metadata) Genres() []string
- func (m *Metadata) ID() metadata.ID
- func (m *Metadata) Letterers() []string
- func (m *Metadata) Notes() string
- func (m *Metadata) Publisher() string
- func (m *Metadata) Score() float32
- func (m *Metadata) StartDate() metadata.Date
- func (m *Metadata) Status() metadata.Status
- func (m *Metadata) String() string
- func (m *Metadata) Tags() []string
- func (m *Metadata) Title() string
- func (m *Metadata) Translators() []string
- func (m *Metadata) URL() string
- type Page
- type PageWithImage
- type Volume
- type VolumeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chapter ¶
type Chapter interface { fmt.Stringer Info() ChapterInfo // Volume gets the Volume that this Chapter is relevant to. // // Implementation should not make any external requests // nor be computationally heavy. Volume() Volume }
Chapter is what Volume consists of. Each chapter is about 24–40 pages.
type ChapterInfo ¶
type ChapterInfo struct { // Title is the title of chapter. Title string `json:"title"` // URL is the url leading to chapter web page. URL string `json:"url"` // Number of the chapter. // // Float type allows for extra chapters that usually have // numbering like the following: 10.5, 101.1, etc.. Number float32 `json:"number"` // Date is the chapter publication date. Date metadata.Date `json:"date"` // ScanlationGroup is the group that did the scan/translation. // // If not an official publication, most of the chapters will belong // to a scanlation group. ScanlationGroup string `json:"scanlation_group"` }
ChapterInfo is the general information for the chapter.
type ChapterWithComicInfoXML ¶
type ChapterWithComicInfoXML interface { Chapter // ComicInfoXML will be used to write ComicInfo.xml file. // // Implementation should not make any external requests. // If found is false then mangal will try to search on Anilist for the // relevant manga. ComicInfoXML() (comicInfoXML metadata.ComicInfoXML, found bool, err error) }
ChapterWithComicInfoXML is a Chapter with an already associated ComicInfoXML.
The associated ComicInfoXML will be used instead of the one generated from the metadata.
type Manga ¶
type Manga interface { fmt.Stringer Info() MangaInfo // Metadata gets the associated metadata of the manga. // // In its unchanged state, it's the basic metadata that is found in the provider itself. Metadata() metadata.Metadata // SetMetadata will replace the current metadata. // // Useful when updating metadata fields. Its implementation should keep the // same pointer address intact, only updating the underlying data. SetMetadata(metadata metadata.Metadata) }
Manga should provide basic information and its metadata found in the provider.
type MangaInfo ¶
type MangaInfo struct { // Title of the manga. Title string `json:"title"` // URL leading to manga page web page. URL string `json:"url"` // ID of the Manga. // // It must be unique within its provider. It will be // part of the URL in most cases. ID string `json:"id"` // Cover is the cover image url. Cover string `json:"cover"` // Banner is the banner image url. // // Not all providers contain a banner image. Banner string `json:"banner"` }
MangaInfo is the general indispensable information for the manga.
type MangaWithSeriesJSON ¶
type MangaWithSeriesJSON interface { Manga // SeriesJSON will be used to write series.json file. // // Implementation should not make any external requests. // If found is false then mangal will try to search on Anilist for the // relevant manga. SeriesJSON() (seriesJSON metadata.SeriesJSON, found bool, err error) }
MangaWithSeriesJSON is a Manga with an already associated SeriesJSON.
The associated SeriesJSON will be used instead of the one generated from the metadata.
type Metadata ¶ added in v0.17.0
type Metadata struct { EnglishTitle string `json:"english_title"` RomajiTitle string `json:"romaji_title"` NativeTitle string `json:"native_title"` Synonyms []string `json:"synonyms"` CommunityScore float32 `json:"community_score"` Summary string `json:"summary"` CoverImage string `json:"cover_image"` BannerImage string `json:"banner_image"` TagList []string `json:"tag_list"` GenreList []string `json:"genre_list"` CharacterList []string `json:"character_list"` AuthorList []string `json:"author_list"` ArtistList []string `json:"artist_list"` TranslatorList []string `json:"translator_list"` LettererList []string `json:"letterer_list"` DateStart metadata.Date `json:"date_start"` DateEnd metadata.Date `json:"date_end"` ProviderPublisher string `json:"provider_publisher"` PublicationStatus metadata.Status `json:"publication_status"` PublicationFormat string `json:"publication_format"` CountryOfOrigin string `json:"country_of_origin"` ChapterCount int `json:"chapter_count"` ExtraNotes string `json:"extra_notes"` SourceURL string `json:"source_url"` ProviderID string `json:"provider_id"` ProviderIDCode string `json:"provider_id_code"` OtherIDs []metadata.ID `json:"other_ids"` }
Metadata is a metadata.Metadata implementation for a generic Provider Metadata, usable by mangadata implementations.
func (*Metadata) AlternateTitles ¶ added in v0.17.0
AlternateTitles is a list of alternative titles in order of relevance.
func (*Metadata) Authors ¶ added in v0.17.0
Authors (or Writers) is the list of authors, in order of relevance. Must contain at least one artist.
func (*Metadata) Characters ¶ added in v0.17.0
Characters is the list of characters, in order of relevance.
func (*Metadata) Country ¶ added in v0.17.0
Country of origin of the manga. ISO 3166-1 alpha-2 country code.
func (*Metadata) Description ¶ added in v0.17.0
Description is the description/summary for the manga.
func (*Metadata) ExtraIDs ¶ added in v0.17.0
ExtraIDs is a list of extra available IDs in the metadata provider. Each extra ID must be valid (ID.Validate).
func (*Metadata) Format ¶ added in v0.17.0
Format the original publication.
For example: TBP, HC, Web, Digital, etc..
func (*Metadata) ID ¶ added in v0.17.0
ID is the ID information of the metadata. Must be valid (ID.Validate).
func (*Metadata) Letterers ¶ added in v0.17.0
Letterers is the list of letterers, in order of relevance.
func (*Metadata) Score ¶ added in v0.17.0
Score is the community score for the manga.
Accepted values are between 0.0 and 5.0.
func (*Metadata) StartDate ¶ added in v0.17.0
StartDate is the date the manga started publishing. Must be non-zero.
func (*Metadata) Status ¶ added in v0.17.0
Current status of the manga. Must be non-empty.
One of: FINISHED, RELEASING, NOT_YET_RELEASED, CANCELLED, HIATUS
func (*Metadata) String ¶ added in v0.17.0
String is the short representation of the manga. Must be non-empty.
At the minimum it should return "`Title` (`Year`)", else "`Title` (`Year`) [`IDCode`id-`ID`]" if available.
func (*Metadata) Title ¶ added in v0.17.0
Title is the English title of the manga. Must be non-empty.
If English is not available, then in in order of availability: Romaji (the romanized title) or Native (usually Kanji).
func (*Metadata) Translators ¶ added in v0.17.0
Translators is the list of translators, in order of relevance.
type Page ¶
type Page interface { fmt.Stringer // Extension gets the image extension of this page. // An extension must start with a dot. // // For example: .jpeg .png Extension() string // Chapter gets the Chapter that this Page is relevant to. // // Implementation should not make any external requests // nor be computationally heavy. Chapter() Chapter }
Page is what Chapter consists of.
type PageWithImage ¶
type PageWithImage interface { Page // Image gets the image contents. // // Implementation should not make any external requests. // Should only be exposed if the Page already contains image contents. Image() []byte // SetImage sets the image contents. This is used by DownloadOptions.ImageTransformer. SetImage(newImage []byte) }
PageWithImage is a Page with already downloaded image.
The associated image will be used instead of downloading one.
type Volume ¶
type Volume interface { fmt.Stringer Info() VolumeInfo // Manga gets the Manga that this Volume is relevant to. // // Implementation should not make any external requests // nor be computationally heavy. Manga() Manga }
Volume of a manga. If a series is popular enough, its chapters are then collected and published into volumes, which usually feature a few chapters of the overall story. Most Manga series are long-running and can span multiple volumes.
At least one volume is expected.
type VolumeInfo ¶
type VolumeInfo struct { // Number of the volume. Number float32 `json:"number"` }
VolumeInfo is the general information for the volume.