metadata

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EpubReader

type EpubReader struct{}

func (EpubReader) Cover

func (e EpubReader) Cover(bookFullPath string, coverMaxWidth int) ([]byte, error)

Cover parses the book looking for a cover image, and extracts it to outputFolder

func (EpubReader) Metadata

func (e EpubReader) Metadata(file string) (Metadata, error)

type Metadata

type Metadata struct {
	ID          string
	Title       string
	Author      string
	Description template.HTML
	Language    string
	Year        string
	Words       float64
	ReadingTime string
	Cover       string
	Series      string
	SeriesIndex float64
}

type Reader

type Reader interface {
	Metadata(file string) (Metadata, error)
	Cover(bookFullPath string, coverMaxWidth int) ([]byte, error)
}

type ReaderMock

type ReaderMock struct {
	MetadataFake func(file string) (Metadata, error)
	CoverFake    func(bookFullPath string) ([]byte, error)
}

func NewReaderMock

func NewReaderMock() ReaderMock

func (ReaderMock) Cover

func (e ReaderMock) Cover(bookFullPath string, coverMaxWidth int) ([]byte, error)

func (ReaderMock) Metadata

func (e ReaderMock) Metadata(file string) (Metadata, error)

Jump to

Keyboard shortcuts

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