mangadex

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package mangadex implements a client which can download chapters from Mangadex

Index

Constants

View Source
const ApiUrl = "https://api.mangadex.org"

Variables

This section is empty.

Functions

This section is empty.

Types

type Chapter

type Chapter struct {
	ID         string            `json:"id"`
	Attributes ChapterAttributes `json:"attributes"`
}

type ChapterAttributes

type ChapterAttributes struct {
	Chapter     string   `json:"chapter"`
	Hash        string   `json:"hash"`
	Data        []string `json:"data"`
	Title       string   `json:"title"`
	Volume      string   `json:"volume"`
	PublishedAt string   `json:"publishAt"`
}

type Chapters

type Chapters []*Chapter

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) CreateChapterArchive

func (c *Client) CreateChapterArchive(ch *Chapter, homeUrl string, forChapter func(i int) error, cont *sync.Controller) (*archive.ZipFile, error)

func (*Client) GetHomeUrl

func (c *Client) GetHomeUrl(cid string) (string, error)

func (*Client) Request added in v0.9.3

func (c *Client) Request(method, endpoint string, payload io.Reader) (*http.Response, error)

type Error

type Error struct {
	ID     string `json:"id"`
	Status int    `json:"status"`
	Title  string `json:"title"`
	Detail string `json:"detail"`
}

Error represents an error returned from Mangadex when attempting to retrieve a Mangadex@Home url

func (Error) Error

func (e Error) Error() string

type Errors

type Errors []Error

type PageInfo

type PageInfo struct {
	// contains filtered or unexported fields
}

PageInfo implements the os.FileInfo interface so that the chapters pages downloaded from Mangadex can be written to archive.ZipFile

func NewPageInfo

func NewPageInfo(name string, size int64, modTime time.Time) *PageInfo

func (*PageInfo) IsDir

func (pi *PageInfo) IsDir() bool

func (*PageInfo) ModTime

func (pi *PageInfo) ModTime() time.Time

func (*PageInfo) Mode

func (pi *PageInfo) Mode() os.FileMode

func (*PageInfo) Name

func (pi *PageInfo) Name() string

func (*PageInfo) Size

func (pi *PageInfo) Size() int64

func (*PageInfo) Sys

func (pi *PageInfo) Sys() interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL