Documentation ¶
Index ¶
- func WithBase(base string) func(*Client)
- func WithHTTPClient(c *http.Client) func(*Client)
- type Author
- type Category
- type Chapter
- type Client
- func (c *Client) Author(id string) (Author, []Manga, error)
- func (c *Client) Chapter(id, cid string) (Chapter, error)
- func (c *Client) Latest(page int) ([]Manga, error)
- func (c *Client) Manga(id string) (MangaSingle, error)
- func (c *Client) Mangas(ids []string) ([]Manga, error)
- func (c *Client) Search(query string) ([]Manga, error)
- type Manga
- type MangaSingle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithHTTPClient ¶
WithHTTPClient makes the manga client use a given http.Client to make requests.
Types ¶
type Author ¶
type Author struct { ID string `json:"oid"` Name string `json:"name"` Thumbnail string `json:"thumbnail"` // Only available if requested through a manga Role string `json:"role"` }
Author of a manga.
type Chapter ¶
type Chapter struct { ID string `json:"oid"` Name string `json:"name"` // Fields only available if requested as a single object Order int `json:"order"` // Fields available if requested as chapter Pages []string `json:"pages"` }
Chapter of a manga.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a MangaRock Client.
func (*Client) Latest ¶
Latest returns the latest mangas. It only uses the manga IDs and requests a list like the one that would be returned by a search. Fields like recently added chapters are missing, but authors are added.
func (*Client) Manga ¶
func (c *Client) Manga(id string) (MangaSingle, error)
Manga returns a single manga. It may contain more fields than a regular one.
type Manga ¶
type Manga struct { ID string `json:"oid"` Name string `json:"name"` Author Author `json:"-"` Authors []Author `json:"authors"` AuthorIDs []string `json:"author_ids"` Genres []string `json:"genres"` Rank int `json:"rank"` UpdatedChapters int `json:"updated_chapters"` NewChapters []Chapter `json:"new_chapters"` Completed bool `json:"cmpleted"` Thumbnail string `json:"thumbnail"` Updated time.Time `json:"updated_at"` }
Manga contains a manga. This struct is returned by endpoints listing mangas.
type MangaSingle ¶
type MangaSingle struct { Manga Description string `json:"description"` Chapters []Chapter `json:"chapters"` Categories []Category `json:"rich_categories"` Cover string `json:"cover"` Artworks []string `json:"artworks"` Aliases []string `json:"alias"` }
MangaSingle contains a manga with additional fields. This struct is returned by requests for a single manga.
Click to show internal directories.
Click to hide internal directories.