readordie

package
v0.0.0-...-4231347 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadAndZip

func DownloadAndZip(manga Manga, chapter Chapter, outputFolder string) error

DownloadAndZip Downloads and generate a zip of a manga chapter

func NewID

func NewID() string

NewID Generates a new random 20 digit string id

func NewIDFromData

func NewIDFromData(data []int) string

NewIDFromData Generates a repeatable 20 digit string id based on the input seed

func RemoveNonAlphanumerical

func RemoveNonAlphanumerical(input string) string

RemoveNonAlphanumerical removes non alphanumerical characters from a string

Types

type Chapter

type Chapter struct {
	ID             string `storm:"id"`
	MangaID        string `storm:"index"`
	Major          uint16 `storm:"index"`
	Minor          uint8  `storm:"index"`
	Version        uint8
	Provider       string
	Link           string
	DownloadedDate time.Time
}

Chapter model

func NewChapter

func NewChapter(mangaID string, provider string, major uint16, minor uint8, version uint8, link string, downloadedDate time.Time) Chapter

NewChapter creates a new Chapter instance

func (Chapter) ListPages

func (ch Chapter) ListPages() ([]Page, error)

ListPages lists pages for this chapter

func (Chapter) String

func (ch Chapter) String() string

type Manga

type Manga struct {
	ID       string `storm:"id"`
	Link     string
	Name     string `storm:"index"`
	Provider string
	Folder   string
}

Manga model

func NewManga

func NewManga(name string, folder string, provider string) (*Manga, error)

NewManga creates a new Manga instance

func (Manga) ListChapters

func (m Manga) ListChapters() ([]Chapter, error)

ListChapters lists all chapters for the current manga available in the provider

func (Manga) String

func (m Manga) String() string

type MangaDex

type MangaDex struct{}

MangaDex provider implementation

func (md MangaDex) GetMangaLink(name string) (string, error)

GetMangaLink satisfies MangaProvider interface

func (MangaDex) ListChapters

func (md MangaDex) ListChapters(manga Manga) ([]Chapter, error)

ListChapters satisfies MangaProvider interface

func (MangaDex) ListPages

func (md MangaDex) ListPages(chapter Chapter) ([]Page, error)

ListPages satisfies MangaProvider interface

type MangaHub

type MangaHub struct{}

MangaHub provider implementation

func (mh MangaHub) GetMangaLink(name string) (string, error)

GetMangaLink satisfies MangaProvider interface

func (MangaHub) ListChapters

func (mh MangaHub) ListChapters(manga Manga) ([]Chapter, error)

ListChapters satisfies MangaProvider interface

func (MangaHub) ListPages

func (mh MangaHub) ListPages(chapter Chapter) ([]Page, error)

ListPages satisfies MangaProvider interface

type MangaProvider

type MangaProvider interface {
	ListChapters(manga Manga) ([]Chapter, error)
	ListPages(chapter Chapter) ([]Page, error)
	GetMangaLink(name string) (string, error)
}

MangaProvider interface for external manga providers

func ProviderFromString

func ProviderFromString(provider string) (MangaProvider, error)

ProviderFromString provides a factory to get a MangaProvider instance from a type string

type MangaSee

type MangaSee struct{}

MangaSee provider implementation

func (ms MangaSee) GetMangaLink(name string) (string, error)

GetMangaLink satisfies MangaProvider interface

func (MangaSee) ListChapters

func (ms MangaSee) ListChapters(manga Manga) ([]Chapter, error)

ListChapters satisfies MangaProvider interface

func (MangaSee) ListPages

func (ms MangaSee) ListPages(chapter Chapter) ([]Page, error)

ListPages satisfies MangaProvider interface

type MangaStream

type MangaStream struct{}

MangaStream provider implementation

func (ms MangaStream) GetMangaLink(name string) (string, error)

GetMangaLink satisfies MangaProvider interface

func (MangaStream) ListChapters

func (ms MangaStream) ListChapters(manga Manga) ([]Chapter, error)

ListChapters satisfies MangaProvider interface

func (MangaStream) ListPages

func (ms MangaStream) ListPages(chapter Chapter) ([]Page, error)

ListPages satisfies MangaProvider interface

type Page

type Page struct {
	Link   string
	Number uint8
}

Page model

type ReadMangaToday

type ReadMangaToday struct{}

ReadMangaToday provider implementation

func (rmt ReadMangaToday) GetMangaLink(name string) (string, error)

GetMangaLink satisfies MangaProvider interface

func (ReadMangaToday) ListChapters

func (rmt ReadMangaToday) ListChapters(manga Manga) ([]Chapter, error)

ListChapters satisfies MangaProvider interface

func (ReadMangaToday) ListPages

func (rmt ReadMangaToday) ListPages(chapter Chapter) ([]Page, error)

ListPages satisfies MangaProvider interface

Jump to

Keyboard shortcuts

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