parser

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoID = errors.New("no ID to parse")

Functions

func CoverLink(mediaID int, format string) string
func ImageLink(mediaID, n int, format string) string

func ParseComic

func ParseComic(r io.Reader) (gnhentai.Doujinshi, error)

func ParseRelated

func ParseRelated(r io.Reader) ([]gnhentai.Doujinshi, error)

func ParseSearch

func ParseSearch(r io.Reader) ([]gnhentai.Doujinshi, error)
func ThumbnailLink(mediaID, n int, format string) string

Types

type Downloader

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

func NewDownloader

func NewDownloader(client *http.Client) Downloader

func (Downloader) Cover

func (d Downloader) Cover(mediaID int) (io.ReadCloser, error)

func (*Downloader) ImageFormat

func (d *Downloader) ImageFormat() string

func (Downloader) Page

func (d Downloader) Page(mediaID, n int) (io.ReadCloser, error)

func (*Downloader) SetImageFormat

func (d *Downloader) SetImageFormat(format string)

func (Downloader) Thumbnail

func (d Downloader) Thumbnail(mediaID, n int) (io.ReadCloser, error)

type Option

type Option func(c *Parser)

func WithClient

func WithClient(client *http.Client) Option

type Parser

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

func NewParser

func NewParser(opts ...Option) *Parser

func (Parser) ByID

func (c Parser) ByID(id int) (gnhentai.Doujinshi, error)

func (Parser) Random

func (c Parser) Random() (gnhentai.Doujinshi, error)

func (Parser) Related

func (c Parser) Related(id int) ([]gnhentai.Doujinshi, error)

func (Parser) Search

func (c Parser) Search(q string, page int) ([]gnhentai.Doujinshi, error)

func (Parser) SearchByTag

func (c Parser) SearchByTag(tag gnhentai.Tag, page int) ([]gnhentai.Doujinshi, error)

Jump to

Keyboard shortcuts

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