Documentation
¶
Index ¶
- Constants
- type Audio
- type Author
- type Body
- type Book
- type CipherData
- type CipherReference
- type Compression
- type Container
- type Content
- type Date
- type EncryptedData
- type Encryption
- type EncryptionMethod
- type EncryptionProperty
- type Identifier
- type KeyInfo
- type Manifest
- type Metadata
- type Metafield
- type NavPoint
- type Ncx
- type Opf
- type PageList
- type PageTarget
- type Par
- type Reference
- type Rootfile
- type SMIL
- type Seq
- type Spine
- type SpineItem
- type Subject
- type Text
- type Title
Constants ¶
const EpubMimeType = "application/epub+zip"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶ added in v0.2.0
type Audio struct {
Src string `xml:"src,attr"`
ClipBegin string `xml:"clipBegin,attr"`
ClipEnd string `xml:"clipEnd,attr"`
}
Audio provides the audio element details
type Author ¶ added in v0.1.1
type Author struct {
Data string `xml:",chardata" json:"author"`
FileAs string `xml:"file-as,attr" json:"file_as"`
Role string `xml:"role,attr" json:"role"`
ID string `xml:"id,attr" json:"id"`
}
Author author
type Body ¶ added in v0.2.0
type Body struct {
TextRef string `xml:"textref,attr"`
Seq []Seq `xml:"seq"`
Par []Par `xml:"par"`
}
Body provides the SMIL body element
type Book ¶
type Book struct {
Ncx Ncx `json:"ncx"`
Opf Opf `json:"opf"`
Container Container `json:"-"`
Mimetype string `json:"-"`
Encryption Encryption `json:"-"`
// contains filtered or unexported fields
}
Book provides the epub book contents
func (*Book) Each ¶ added in v0.2.0
func (p *Book) Each(fn func(string, io.ReadCloser)) error
Each provides an iterator over each book section passing its title and contents
func (*Book) ZipReader ¶ added in v0.2.0
func (p *Book) ZipReader() *zip.ReadCloser
ZipReader returns the internal file descriptor
type CipherData ¶ added in v0.2.0
type CipherData struct {
CipherReference CipherReference `xml:"CipherReference"`
}
CipherData provides the encryption cipher information
type CipherReference ¶ added in v0.2.0
type CipherReference struct {
URI string `xml:"URI,attr"`
}
CipherReference provides the encryption
type Compression ¶ added in v0.2.0
type Compression struct {
Method string `xml:"Method,attr"`
OriginalLength string `xml:"OriginalLength,attr"`
}
Compression provides encryption compression details
type Container ¶
type Container struct {
Rootfile Rootfile `xml:"rootfiles>rootfile" json:"rootfile"`
}
Container META-INF/container.xml file
type Content ¶ added in v0.1.1
type Content struct {
Src string `xml:"src,attr" json:"src"`
}
Content nav-point content
type Date ¶ added in v0.1.1
type Date struct {
Data string `xml:",chardata" json:"data"`
Event string `xml:"event,attr" json:"event"`
}
Date date
type EncryptedData ¶ added in v0.2.0
type EncryptedData struct {
EncryptionMethod EncryptionMethod `xml:"EncryptionMethod"`
KeyInfo KeyInfo `xml:"KeyInfo"`
CipherData CipherData `xml:"CipherData"`
EncryptionProperties []EncryptionProperty `xml:"EncryptionProperties>EncryptionProperty"`
}
EncryptedData provides encryption information
type Encryption ¶ added in v0.2.0
type Encryption struct {
EncryptedData []EncryptedData `xml:"EncryptedData" json:"encrypted_data"`
}
Encryption encryption.xml
type EncryptionMethod ¶ added in v0.2.0
type EncryptionMethod struct {
Algorithm string `xml:"Algorithm,attr"`
}
EncryptionMethod provides the encryption algorithm
type EncryptionProperty ¶ added in v0.2.0
type EncryptionProperty struct {
Compression Compression `xml:"Compression"`
}
EncryptionProperty provides encryption compression information
type Identifier ¶ added in v0.1.1
type Identifier struct {
Data string `xml:",chardata" json:"data"`
ID string `xml:"id,attr" json:"id"`
Scheme string `xml:"scheme,attr" json:"scheme"`
}
Identifier identifier
type KeyInfo ¶ added in v0.2.0
type KeyInfo struct {
Resource string `xml:",chardata"`
}
KeyInfo provides the encryption key details
type Manifest ¶ added in v0.1.1
type Manifest struct {
ID string `xml:"id,attr" json:"id"`
Href string `xml:"href,attr" json:"href"`
MediaType string `xml:"media-type,attr" json:"type"`
Fallback string `xml:"media-fallback,attr" json:"fallback"`
Properties string `xml:"properties,attr" json:"properties"`
MediaOverlay string `xml:"media-overlay,attr" json:"overlay"`
}
Manifest manifest
type Metadata ¶ added in v0.1.1
type Metadata struct {
Title []Title `xml:"title" json:"title"`
Language []string `xml:"language" json:"language"`
Identifier []Identifier `xml:"identifier" json:"identifier"`
Creator []Author `xml:"creator" json:"creator"`
Subject []Subject `xml:"subject" json:"subject"`
Description []string `xml:"description" json:"description"`
Publisher []string `xml:"publisher" json:"publisher"`
Contributor []Author `xml:"contributor" json:"contributor"`
Date []Date `xml:"date" json:"date"`
Type []string `xml:"type" json:"type"`
Format []string `xml:"format" json:"format"`
Source []string `xml:"source" json:"source"`
Relation []string `xml:"relation" json:"relation"`
Coverage []string `xml:"coverage" json:"coverage"`
Rights []string `xml:"rights" json:"rights"`
Meta []Metafield `xml:"meta" json:"meta"`
Guide []Reference `xml:"guide" json:"guide"`
}
Metadata provides epub metadata
type Metafield ¶ added in v0.1.1
type Metafield struct {
Name string `xml:"name,attr" json:"name"`
Content string `xml:"content,attr" json:"content"`
Refine string `xml:"refines,attr" json:"refines"`
Property string `xml:"property,attr" json:"property"`
Data string `xml:",chardata" json:"data"`
ID string `xml:"id,attr" json:"id"`
Lang string `xml:"lang,attr" json:"lang"`
}
Metafield metafield
type Ncx ¶
type Ncx struct {
Points []NavPoint `xml:"navMap>navPoint" json:"points"`
PageList PageList `xml:"pageList" json:"page_list"`
}
Ncx OPS/toc.ncx
type Opf ¶
type Opf struct {
Metadata Metadata `xml:"metadata" json:"metadata"`
Manifest []Manifest `xml:"manifest>item" json:"manifest"`
Spine Spine `xml:"spine" json:"spine"`
UniqueIdentifier string `xml:"unique-identifier,attr" json:"unique-identifier"`
Dir string `xml:"dir,attr" json:"dir"`
Version string `xml:"version,attr" json:"version"`
}
Opf content.opf
type PageList ¶ added in v0.2.0
type PageList struct {
PageTarget []PageTarget `xml:"pageTarget" json:"page_targets"`
Class string `xml:"class" json:"class"`
ID string `xml:"id" json:"id"`
}
PageList page list
type PageTarget ¶ added in v0.2.0
type PageTarget struct {
Text string `xml:"navLabel>text" json:"text"`
Value string `xml:"value" json:"value"`
Type string `xml:"type" json:"type"`
PlayOrder int `xml:"playOrder" json:"play_order"`
Content Content `xml:"content" json:"content"`
}
PageTarget page target
type Reference ¶ added in v0.2.0
type Reference struct {
Href string `xml:"href,attr" json:"href"`
Title string `xml:"title,attr" json:"title"`
Type string `xml:"type,attr" json:"type"`
}
Reference reference in guide
type Rootfile ¶ added in v0.1.1
type Rootfile struct {
Path string `xml:"full-path,attr" json:"path"`
Type string `xml:"media-type,attr" json:"type"`
Version string `xml:"version,attr" json:"version"`
}
Rootfile root file
type SMIL ¶ added in v0.2.0
type SMIL struct {
Body Body `xml:"body"`
}
SMIL or Synchronized Multimedia Integration Language, wrapper
type Spine ¶ added in v0.1.1
type Spine struct {
ID string `xml:"id,attr" json:"id"`
Toc string `xml:"toc,attr" json:"toc"`
PageProgression string `xml:"page-progression-direction,attr" json:"progression"`
Items []SpineItem `xml:"itemref" json:"items"`
}
Spine spine
type SpineItem ¶ added in v0.1.1
type SpineItem struct {
IDref string `xml:"idref,attr" json:"id_ref"`
Linear string `xml:"linear,attr" json:"linear"`
ID string `xml:"id,attr" json:"id"`
Properties string `xml:"properties,attr" json:"properties"`
}
SpineItem spine item
type Subject ¶ added in v0.2.0
type Subject struct {
Data string `xml:",chardata" json:"data"`
Term string `xml:"term,attr" json:"term"`
Authority string `xml:"authority,attr" json:"authority"`
Lang string `xml:"lang,attr" json:"lang"`
}
Subject subject