mangadexapi

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknown    = errors.New("unknown error")
	ErrBadInput   = errors.New("bad input")
	ErrConnection = errors.New("request is failed")
)

Functions

func GetMangaIdFromArg added in v1.0.1

func GetMangaIdFromArg(args []string) string

func GetMangaIdFromUrl added in v1.0.1

func GetMangaIdFromUrl(link string) string

func NewClient

func NewClient(userAgent string) clientapi

Types

type Chapter

type Chapter struct {
	ID            string         `json:"id"`
	Type          string         `json:"type"`
	Attributes    ChapterAttr    `json:"attributes"`
	Relationships []Relationship `json:"relationships"`
}

func (Chapter) Number added in v1.2.0

func (c Chapter) Number() string

func (Chapter) PagesCount added in v1.2.0

func (c Chapter) PagesCount() int

func (Chapter) Title added in v1.2.0

func (c Chapter) Title() string

func (Chapter) UploadedBy added in v1.2.0

func (c Chapter) UploadedBy() string

func (Chapter) Volume added in v1.2.0

func (c Chapter) Volume() string

type ChapterAttr

type ChapterAttr struct {
	Volume             string    `json:"volume"`
	Chapter            string    `json:"chapter"`
	Title              string    `json:"title"`
	TranslatedLanguage string    `json:"translatedLanguage"`
	ExternalUrl        string    `json:"externalUrl"`
	PublishAt          time.Time `json:"publishAt"`
	ReadableAt         time.Time `json:"readableAt"`
	CreatedAt          time.Time `json:"createdAt"`
	UpdatedAt          time.Time `json:"updatedAt"`
	Pages              int       `json:"pages"`
	Version            int       `json:"version"`
}

type ChapterFullInfo added in v1.2.0

type ChapterFullInfo struct {
	DownloadBaseURL string
	HashId          string
	PngFiles        []string
	JpgFiles        []string
	// contains filtered or unexported fields
}

not used for requests or responses

func (ChapterFullInfo) ImagesBaseUrl added in v1.2.0

func (c ChapterFullInfo) ImagesBaseUrl() string

func (ChapterFullInfo) ImagesCompressedFiles added in v1.2.0

func (c ChapterFullInfo) ImagesCompressedFiles() []string

func (ChapterFullInfo) ImagesFiles added in v1.2.0

func (c ChapterFullInfo) ImagesFiles() []string

func (ChapterFullInfo) Language added in v1.2.0

func (c ChapterFullInfo) Language() string

func (ChapterFullInfo) Number added in v1.2.0

func (c ChapterFullInfo) Number() string

func (ChapterFullInfo) Title added in v1.2.0

func (c ChapterFullInfo) Title() string

func (ChapterFullInfo) Translator added in v1.2.0

func (c ChapterFullInfo) Translator() string

func (ChapterFullInfo) UploadedBy added in v1.2.0

func (c ChapterFullInfo) UploadedBy() string

func (ChapterFullInfo) Volume added in v1.2.0

func (c ChapterFullInfo) Volume() string

type ChapterMetaInfo added in v1.2.0

type ChapterMetaInfo struct {
	Hash      string   `json:"hash"`
	Data      []string `json:"data"`
	DataSaver []string `json:"dataSaver"`
}

type ErrorDetail

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

type ErrorResponse

type ErrorResponse struct {
	Result string        `json:"result"`
	Errors []ErrorDetail `json:"errors"`
}

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type MangaAttrib

type MangaAttrib struct {
	Title                          map[string]string   `json:"title"`
	AltTitles                      []map[string]string `json:"altTitles"`
	Description                    map[string]string   `json:"description"`
	IsLocked                       bool                `json:"isLocked"`
	Links                          map[string]string   `json:"links"`
	OriginalLanguage               string              `json:"originalLanguage"`
	LastVolume                     string              `json:"lastVolume"`
	LastChapter                    string              `json:"lastChapter"`
	PublicationDemographic         string              `json:"publicationDemographic"`
	Status                         string              `json:"status"`
	Year                           int                 `json:"year"`
	ContentRating                  string              `json:"contentRating"`
	Tags                           []MangaTag          `json:"tags"`
	State                          string              `json:"state"`
	ChapterNumbersResetOnNewVolume bool                `json:"chapterNumbersResetOnNewVolume"`
	CreatedAt                      time.Time           `json:"createdAt"`
	UpdatedAt                      time.Time           `json:"updatedAt"`
	Version                        int                 `json:"version"`
	AvailableTranslatedLanguages   []string            `json:"availableTranslatedLanguages"`
	LatestUploadedChapter          string              `json:"latestUploadedChapter"`
}

type MangaInfo

type MangaInfo struct {
	ID            string         `json:"id"`
	Type          string         `json:"type"`
	Attributes    MangaAttrib    `json:"attributes"`
	Relationships []Relationship `json:"relationships"`
}

func (MangaInfo) GetAltTitles

func (mi MangaInfo) GetAltTitles() string

func (MangaInfo) GetArtists

func (mi MangaInfo) GetArtists() string

func (MangaInfo) GetAuthors

func (mi MangaInfo) GetAuthors() string
func (mi MangaInfo) GetLinks() []string

func (MangaInfo) GetTags

func (mi MangaInfo) GetTags() string

type MangaInfoResponse

type MangaInfoResponse struct {
	Result   string    `json:"result"`
	Response string    `json:"response"`
	Data     MangaInfo `json:"data"`
}

type MangaTag

type MangaTag struct {
	ID         string `json:"id"`
	Type       string `json:"type"`
	Attributes struct {
		Name        map[string]string `json:"name"`
		Description struct{}          `json:"description"`
		Group       string            `json:"group"`
		Version     int               `json:"version"`
	} `json:"attributes"`
	Relationships []interface{} `json:"relationships"`
}

type RelAttribute

type RelAttribute struct {
	Name        string `json:"name"`
	Username    string `json:"username"`
	Description string `json:"description"`
}

type Relationship

type Relationship struct {
	ID         string       `json:"id"`
	Type       string       `json:"type"`
	Related    string       `json:"related,omitempty"`
	Attributes RelAttribute `json:"attributes"`
}

type ResponseChapterImages

type ResponseChapterImages struct {
	Result          string          `json:"result"`
	BaseURL         string          `json:"baseUrl"`
	ChapterMetaInfo ChapterMetaInfo `json:"chapter"`
}

type ResponseChapterList

type ResponseChapterList struct {
	Result   string    `json:"result"`
	Response string    `json:"response"`
	Data     []Chapter `json:"data"`
	Limit    int       `json:"limit"`
	Offset   int       `json:"offset"`
	Total    int       `json:"total"`
}

func (ResponseChapterList) GetChapters added in v1.2.0

func (l ResponseChapterList) GetChapters(lowest, highest int, transgp string) ([]Chapter, int)

type ResponseMangaList

type ResponseMangaList struct {
	Result   string      `json:"result"`
	Response string      `json:"response"`
	Data     []MangaInfo `json:"data"`
	Limit    int         `json:"limit"`
	Offset   int         `json:"offset"`
	Total    int         `json:"total"`
}

Jump to

Keyboard shortcuts

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