Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileNotFound = errors.New("epub: no '%s' found in file") ErrNoISBN = errors.New("epub: no ISBN found in file") ErrNoMimetype = errors.New("epub: no mimetype found in file") ErrNoContainer = errors.New("epub: no no container.xml") ErrNoRootfile = errors.New("epub: no rootfile found in container") // ErrBadRootfile occurs when container.xml references a rootfile that does // not exist in the zip. ErrBadRootfile = errors.New("epub: container references non-existent rootfile") // ErrNoItemref occurrs when a content.opf contains a spine without any // itemref entries. ErrNoItemref = errors.New("epub: no itemrefs found in spine") // ErrBadItemref occurs when an itemref entry in content.opf references an // item that does not exist in the manifest. ErrBadItemref = errors.New("epub: itemref references non-existent item") // ErrBadManifest occurs when a manifest in content.opf references an item // that does not exist in the zip. ErrBadManifest = errors.New("epub: manifest references non-existent item") )
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
Rootfiles []*Rootfile `xml:"rootfiles>rootfile"`
}
Container serves as a directory of Rootfiles.
type EpubReader ¶
func (*EpubReader) GetCover ¶
func (epubReader *EpubReader) GetCover() (string, error)
func (*EpubReader) GetISBN ¶
func (epubReader *EpubReader) GetISBN() (string, error)
type EpubReaderCloser ¶
type EpubReaderCloser struct { EpubReader // contains filtered or unexported fields }
func OpenReader ¶
func OpenReader(filename string) (*EpubReaderCloser, error)
func (*EpubReaderCloser) Close ¶
func (epubReaderCloser *EpubReaderCloser) Close()
type Package ¶
type Package struct { XMLName xml.Name `xml:"package"` Text string `xml:",chardata"` Xmlns string `xml:"xmlns,attr"` UniqueIdentifier string `xml:"unique-identifier,attr"` Version string `xml:"version,attr"` Metadata struct { Text string `xml:",chardata"` Dc string `xml:"dc,attr"` Opf string `xml:"opf,attr"` Title string `xml:"title"` Creator struct { Text string `xml:",chardata"` Role string `xml:"role,attr"` FileAs string `xml:"file-as,attr"` } `xml:"creator"` Identifier []struct { Text string `xml:",chardata"` ID string `xml:"id,attr"` Scheme string `xml:"scheme,attr"` } `xml:"identifier"` Date string `xml:"date"` Publisher string `xml:"publisher"` Description string `xml:"description"` Contributor struct { Text string `xml:",chardata"` Role string `xml:"role,attr"` } `xml:"contributor"` Subject string `xml:"subject"` Language string `xml:"language"` Meta []struct { Text string `xml:",chardata"` Name string `xml:"name,attr"` Content string `xml:"content,attr"` } `xml:"meta"` } `xml:"metadata"` Manifest struct { Text string `xml:",chardata"` Item []struct { Text string `xml:",chardata"` Href string `xml:"href,attr"` ID string `xml:"id,attr"` MediaType string `xml:"media-type,attr"` } `xml:"item"` } `xml:"manifest"` Spine struct { Text string `xml:",chardata"` Toc string `xml:"toc,attr"` Itemref []struct { Text string `xml:",chardata"` Idref string `xml:"idref,attr"` } `xml:"itemref"` } `xml:"spine"` Guide struct { Text string `xml:",chardata"` Reference []struct { Text string `xml:",chardata"` Href string `xml:"href,attr"` Title string `xml:"title,attr"` Type string `xml:"type,attr"` } `xml:"reference"` } `xml:"guide"` }
Click to show internal directories.
Click to hide internal directories.