book

package
v0.0.0-...-f58ca8c Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chapter

type Chapter struct {
	ChapterNumber int          `json:"chapterNumber"`
	ChapterName   string       `json:"chapterName"`
	Images        []string     `json:"images"`
	Content       []PageObject `json:"content"`
	URL           string       `json:"url"`
}

Chapter represents a Chapter in a book.

type Exporters

type Exporters string

Exporters declares available exporters

const (
	//EPUB expors as epub
	EPUB Exporters = "epub"
	//PDF exports as PDF
	PDF Exporters = "pdf"
)

type Metadata

type Metadata struct {
	Website     ScrapingWebsite `json:"website" yaml:"Website"`
	Title       string          `json:"title" yaml:"Title"`
	Author      string          `json:"author" yaml:"Author"`
	Language    string          `json:"language" yaml:"Language"`
	Year        string          `json:"year" yaml:"Year"`
	Cover       string          `json:"cover" yaml:"CoverImageURL"`
	ChapterURLs []string        `json:"chapterURLs" yaml:"ChapterURLs"`
	Format      Exporters       `json:"exportFormat" yaml:"ExportFormat"`
}

Metadata stores metadata for books

type PageImage

type PageImage struct {
	ID     uint   `json:"id"`
	Image  string `json:"image"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

PageImage is used to store an image on a page

func NewPageImage

func NewPageImage(height int, width int, imagePath string) *PageImage

NewPageImage creates a new page

func (*PageImage) GetID

func (p *PageImage) GetID() uint

GetID gets the ID of the current instance

type PageObject

type PageObject interface {
	GetID() uint
}

PageObject is an arbitary object on a page

type Paragraph

type Paragraph struct {
	ID      uint   `json:"id"`
	Content string `json:"content"`
}

Paragraph represents a Paragraph in a chapter

func NewParagraph

func NewParagraph(content string) *Paragraph

NewParagraph creates a new paragraph

func (*Paragraph) GetID

func (p *Paragraph) GetID() uint

GetID gets the id of the current paragraph

type ScrapingWebsite

type ScrapingWebsite string

ScrapingWebsite declares supported scraping websites

const (
	//CRIMSON scrapes from crimsonmagic
	CRIMSON ScrapingWebsite = "crimsonmagic"
	//WUXIA scrapes from wuxia
	WUXIA ScrapingWebsite = "wuxia"
	//FULLBOOKEDTLS for fullbookedtls
	FULLBOOKEDTLS ScrapingWebsite = "fullybookedtls"
)

type Volume

type Volume struct {
	Chapters []Chapter `json:"chapters"`
	Metadata Metadata  `json:"metadata"`
}

Volume represents a book that consists of chapters

Jump to

Keyboard shortcuts

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