mangadex

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CoverBaseURL, _ = url.Parse("https://uploads.mangadex.org/covers/")

Functions

This section is empty.

Types

type Chapter

type Chapter struct {
	Info  ChapterInfo
	Pages map[int]image.Image
}

func (Chapter) Keys

func (c Chapter) Keys() []int

func (Chapter) Sorted

func (c Chapter) Sorted() []image.Image

type ChapterInfo

type ChapterInfo struct {
	Title      string
	Views      int
	Language   language.Tag
	GroupNames multiple
	Published  time.Time
	ID         string

	// identifiers
	Identifier       Identifier
	VolumeIdentifier Identifier
}

type ChapterList

type ChapterList []Chapter

func (ChapterList) CollapseBy

func (m ChapterList) CollapseBy(f func(ChapterInfo) interface{}) ChapterList

func (ChapterList) FilterBy

func (m ChapterList) FilterBy(f func(ChapterInfo) bool) ChapterList

func (ChapterList) SortBy

func (m ChapterList) SortBy(f func(ChapterInfo, ChapterInfo) bool) ChapterList

this function currently also affects the contents of the original slice

type Client

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

func NewClient

func NewClient() *Client

func (*Client) FetchChapters

func (c *Client) FetchChapters(ctx context.Context, mangaID string) (ChapterList, error)

func (*Client) FetchCovers

func (c *Client) FetchCovers(ctx context.Context, mangaID string) (PathList, error)

func (*Client) FetchLegacy

func (c *Client) FetchLegacy(ctx context.Context, tp string, legacyID int) (string, error)

func (*Client) FetchManga

func (c *Client) FetchManga(ctx context.Context, mangaID string) (*Manga, error)

func (*Client) FetchPaths

func (c *Client) FetchPaths(ctx context.Context, chapter *Chapter) (PathList, error)

func (*Client) WithHTTPClient

func (c *Client) WithHTTPClient(http *http.Client) *Client

type Identifier

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

func NewIdentifier

func NewIdentifier(id string) Identifier

func NewWithFallback

func NewWithFallback(id string, fallback string) Identifier

func UnknownIdentifier

func UnknownIdentifier() Identifier

func (Identifier) Equal

func (n Identifier) Equal(o Identifier) bool

func (Identifier) IsNext

func (n Identifier) IsNext(o Identifier) bool

func (Identifier) IsSpecial

func (n Identifier) IsSpecial() bool

func (Identifier) IsUnknown

func (n Identifier) IsUnknown() bool

func (Identifier) Less

func (n Identifier) Less(o Identifier) bool

func (Identifier) LessOrEqual

func (n Identifier) LessOrEqual(o Identifier) bool

func (Identifier) MarshalText

func (n Identifier) MarshalText() ([]byte, error)

func (Identifier) String

func (n Identifier) String() string

func (Identifier) StringFilled

func (n Identifier) StringFilled(before, after int, forceAfter bool) string

func (*Identifier) UnmarshalJSON

func (n *Identifier) UnmarshalJSON(data []byte) error

func (*Identifier) UnmarshalText

func (n *Identifier) UnmarshalText(data []byte) error

type Image

type Image struct {
	Image image.Image

	// identifiers
	ImageIdentifier   int
	ChapterIdentifier Identifier
	VolumeIdentifier  Identifier
}

type ImageList

type ImageList []Image

type Manga

type Manga struct {
	Info    MangaInfo
	Volumes map[Identifier]Volume
}

func (Manga) Chapters

func (m Manga) Chapters() ChapterList

func (Manga) Keys

func (m Manga) Keys() []Identifier

func (Manga) Sorted

func (m Manga) Sorted() []Volume

func (Manga) WithChapters

func (m Manga) WithChapters(chapters ChapterList) Manga

func (Manga) WithCovers

func (m Manga) WithCovers(covers ImageList) Manga

func (Manga) WithPages

func (m Manga) WithPages(pages ImageList) Manga

type MangaInfo

type MangaInfo struct {
	Title   string
	Authors multiple
	Artists multiple
	ID      string
}

type Path

type Path struct {
	DataURL      string
	DataSaverURL string

	// identifiers
	ImageIdentifier   int
	ChapterIdentifier Identifier
	VolumeIdentifier  Identifier
}

func (Path) WithImage

func (i Path) WithImage(img image.Image) Image

type PathList

type PathList []Path

func (PathList) FilterBy

func (m PathList) FilterBy(f func(Path) bool) PathList

type Volume

type Volume struct {
	Info     VolumeInfo
	Chapters map[Identifier]Chapter
	Cover    image.Image
}

func (Volume) Keys

func (v Volume) Keys() []Identifier

func (Volume) Sorted

func (v Volume) Sorted() ChapterList

type VolumeInfo

type VolumeInfo struct {
	Identifier Identifier
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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