ebook

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindEpubs

func FindEpubs(directoryPath string) ([]string, error)

FindEpubs scans a directory recursively and returns contained epub paths

Types

type Book

type Book struct {
	ID          string
	Path        string
	Title       string
	Author      string
	Description string
	Series      string
	SeriesIndex int
	ModTime     time.Time
}

Book represents an ebook. It's the main structure of this application

type BookWithCover

type BookWithCover struct {
	*Book
	Cover image.Image
}

BookWithCover wraps a Book to add cover image information

type EpubLoader

type EpubLoader struct{}

EpubLoader is a MetadataLoader extracting metadata from EPUB files

func (*EpubLoader) GetModTime added in v0.3.0

func (loader *EpubLoader) GetModTime(path string) (time.Time, error)

GetModTime returns file modification time, without actually loading the epub.

func (*EpubLoader) Load

func (loader *EpubLoader) Load(path string) (*BookWithCover, error)

Load will extract epub metadata

type MetadataLoader

type MetadataLoader interface {
	Load(filepath string) (*BookWithCover, error)
	GetModTime(filepath string) (time.Time, error)
}

MetadataLoader describe objects able to retrieve metadata from a file

Jump to

Keyboard shortcuts

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