metadata

package
v4.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: GPL-3.0 Imports: 22 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 {
	GetMetadataFromFile func(path string) (*epub.Information, error)
	GetPackageFromFile  func(path string) (*epub.PackageDocument, error)
}

func NewEpubReader added in v4.4.0

func NewEpubReader() EpubReader

func (EpubReader) Cover

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

Cover parses the document looking for a cover image and returns it

func (EpubReader) Metadata

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

type Metadata

type Metadata struct {
	Title       string
	Authors     []string
	Description template.HTML
	Language    string
	Year        string
	Words       float64
	Series      string
	SeriesIndex float64
	Pages       int
	Format      string
	Subjects    []string
}

func (Metadata) ReadingTime

func (m Metadata) ReadingTime(wordsPerMinute float64) string

type PdfReader

type PdfReader struct{}

func (PdfReader) Cover

func (p PdfReader) Cover(documentFullPath string, coverMaxWidth int) ([]byte, error)

Cover parses the document looking for a cover image and returns it

func (PdfReader) Metadata

func (p PdfReader) Metadata(file string) (Metadata, error)

type Reader

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

Jump to

Keyboard shortcuts

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