Documentation
¶
Overview ¶
Package mangoplus provides an API wrapper for MangaPlus API.
Index ¶
- Constants
- type AllTitlesGroup
- type AllTitlesViewV2
- type Chapter
- type ChapterListGroup
- type ErrorResponse
- type Label
- type Languages
- type MangaPage
- type MangaService
- type MangaViewer
- type Page
- type PageService
- type PlusClient
- type PlusResponse
- type Popup
- type SuccessResponse
- type Title
- type TitleDetailView
- type TitleLabels
Constants ¶
View Source
const ( OriginURL = "https://mangaplus.shueisha.co.jp" BaseAPI = "https://jumpg-webapi.tokyo-cdn.com/api" )
View Source
const ( AllMangaPath = "title_list/allV2" MangaPath = "title_detailV3" )
View Source
const (
PagePath = "manga_viewer"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllTitlesGroup ¶
type AllTitlesViewV2 ¶
type AllTitlesViewV2 struct {
AllTitlesGroup []AllTitlesGroup `json:"allTitlesGroup"`
}
type Chapter ¶
type Chapter struct {
TitleId int `json:"titleId"`
ChapterId int `json:"chapterId"`
Name string `json:"name"`
SubTitle *string `json:"subTitle"`
ThumbnailUrl string `json:"thumbnailUrl"`
StartTimeStamp int `json:"startTimeStamp"`
EndTimeStamp int `json:"endTimeStamp"`
AlreadyViewed bool `json:"alreadyViewed"`
ViewCount int `json:"viewCount"`
CommentCount int `json:"commentCount"`
IsVerticalOnly bool `json:"isVerticalOnly"`
}
type ChapterListGroup ¶
type ErrorResponse ¶
type ErrorResponse struct {
EnglishPopup *Popup `json:"englishPopup"`
SpanishPopup *Popup `json:"spanishPopup"`
Popups *[]Popup `json:"popups"`
}
ErrorResponse: Generic error response.
func (*ErrorResponse) GetErrors ¶
func (error *ErrorResponse) GetErrors() string
TODO: handle one specific language instead of the first in the list
GetErrors: Get the errors for this particular request.
type MangaService ¶
type MangaService service
MangaService: Provides Manga services provided by the API.
func (*MangaService) All ¶
func (s *MangaService) All() ([]AllTitlesGroup, error)
All: Get list of all manga.
func (*MangaService) Get ¶
func (s *MangaService) Get(id string) (TitleDetailView, error)
Get: Get manga details by ID.
type MangaViewer ¶
type MangaViewer struct {
Pages []Page `json:"pages"`
ChapterID int `json:"chapterId"`
Chapters []Chapter `json:"chapters"` // Probably not really needed
TitleName string `json:"titleName"`
ChapterName string `json:"chapterName"`
NumberOfComments int `json:"numberOfComments"`
TitleID int `json:"titleId"`
RegionCode string `json:"regionCode"`
TitleLanguage string `json:"titleLanguage"`
}
type PageService ¶
type PageService service
PageService: Provides Page services provided by the API.
type PlusClient ¶
type PlusClient struct {
// Services for MangaPlus API.
Manga *MangaService
Page *PageService
// contains filtered or unexported fields
}
PlusClient: The MangaPlus client.
func (*PlusClient) Request ¶
func (c *PlusClient) Request(ctx context.Context, method, url string, body io.Reader) (PlusResponse, error)
Request: Sends a request to the MangaPlus API and decodes into a PlusResponse.
type PlusResponse ¶
type PlusResponse struct {
Success *SuccessResponse `json:"success"`
Error *ErrorResponse `json:"error"`
}
PlusResponse: Generic MangaPlus API response type, most responses have this structure.
type SuccessResponse ¶
type SuccessResponse struct {
IsFeaturedUpdated *bool `json:"isFeaturedUpdated"`
TitleDetailView *TitleDetailView `json:"titleDetailView"`
MangaViewer *MangaViewer `json:"mangaViewer"`
AllTitlesViewV2 *AllTitlesViewV2 `json:"allTitlesViewV2"`
Languages *Languages `json:"languages"`
}
SuccessResponse: Generic success response.
type TitleDetailView ¶
type TitleDetailView struct {
Title Title `json:"title"`
TitleImageUrl string `json:"titleImageUrl"`
Overview string `json:"overview"`
NextTimeStamp int `json:"nextTimeStamp"`
ViewingPeriodDescription string `json:"viewingPeriodDescription"`
ChapterListGroup []ChapterListGroup `json:"chapterListGroup"`
IsSimulReleased bool `json:"isSimulReleased"`
Rating string `json:"rating"`
NumberOfViews int `json:"numberOfViews"`
RegionCode string `json:"regionCode"`
Label *Label `json:"label"`
IsFirstTimeFree bool `json:"isFirstTimeFree"`
}
type TitleLabels ¶
Click to show internal directories.
Click to hide internal directories.