Documentation
¶
Overview ¶
Package logic contains the logic used on manga-toolkit clients
Index ¶
- func AddPage(pdf fpdf.Pdf, imgType string, buffer *bytes.Buffer)
- func EncodePage(image Page, buffer *bytes.Buffer) error
- func GenerateOutput(chapter Chapter, output io.WriteCloser) error
- func GetImageFormat(image Page) (string, error)
- func IsValidExtension(ext string) bool
- type Chapter
- type Logic
- type Page
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePage ¶
EncodePage encode a manga image page into the provided buffer If the page is on landscape mode it'll be rotated -90 degrees and will became portrait mode
func GenerateOutput ¶
func GenerateOutput(chapter Chapter, output io.WriteCloser) error
func GetImageFormat ¶
GetImageFormat extracts the image format from the manga image page
func IsValidExtension ¶
IsValidExtension check if the image has a valid extension
Types ¶
type Chapter ¶
type Chapter struct {
Pages []Page
}
func NewChapter ¶
NewChapter iterate through the ZIP file, open the content and return a list of images. Remember to close the images after using it!
type Logic ¶
type Logic interface {
GeneratePDFFromZip(ctx context.Context, reader *zip.ReadCloser, output io.WriteCloser) error
DownloadChapters(ctx context.Context, mangaTerm string, outputDir string, fromChapter int, toChapter int) error
}
Logic abstracts the logic used on manga-toolkit
func NewLogic ¶
func NewLogic(mangaFreakService services.MangaFreakService) Logic
NewLogic builds the logic used on manga-toolkit
Click to show internal directories.
Click to hide internal directories.