Documentation
¶
Index ¶
Constants ¶
const ( PropertyCover = "cover-image" MetaNameCover = "cover" ContainerPath = "META-INF/container.xml" )
Variables ¶
var ( ErrInvalid = errors.New("epub: invalid file") ErrNotFound = errors.New("epub: file not found") )
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { RootFile struct { FullPath string `xml:"full-path,attr"` } `xml:"rootfiles>rootfile"` }
type Epub ¶
type Epub struct { Container *Container Package *Package // contains filtered or unexported fields }
func (Epub) GetCoverFile ¶
GetCoverFile returns the cover file from the EPUB. Returns nil if the cover file cannot be opened.
func (Epub) GetDir ¶
GetDir returns the directory path for a file identified by the given ID reference. Returns an empty string if the ID reference is not found.
func (Epub) GetFile ¶
GetFile returns a file from the EPUB identified by the given ID reference. Returns nil if the ID reference is not found or the file cannot be opened.
func (Epub) GetFileFromPath ¶
GetFileFromPath returns a file from the EPUB at the specified path. Returns nil if the file cannot be opened.
func (Epub) GetFilename ¶
GetFilename returns the filename for a file identified by the given ID reference. Returns an empty string if the ID reference is not found.
func (Epub) GetSpineIDRefs ¶
GetSpineIDRefs returns a slice of all ID references in the EPUB's spine. The spine defines the reading order of the EPUB content.
type Manifest ¶
type Manifest struct { Items []ManifestItem `xml:"item"` IDMap map[string]ManifestItem }
type ManifestItem ¶
type Metadata ¶
type Metadata struct { Identifier string `xml:"identifier"` Title string `xml:"title"` Language string `xml:"language"` Publisher string `xml:"publisher"` Date string `xml:"date"` Description string `xml:"description"` Creator string `xml:"creator"` CoverPath string Meta []struct { Name string `xml:"name,attr"` Content string `xml:"content,attr"` } `xml:"meta"` }