epub

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2016 License: MIT Imports: 7 Imported by: 0

README

Epub library for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unzip

func Unzip(archive, target string) error

func Walk

func Walk(root string, fn WalkFunc) error

Types

type Book

type Book struct {
	MimeType  string
	Container *Container
}

func Open

func Open(archive string) (*Book, error)

type Container

type Container struct {
	XMLName   xml.Name   `xml:"container"`
	RootFiles []RootFile `xml:"rootfiles>rootfile"`
}

type Item

type Item struct {
	Id        string `xml:"id,attr"`
	Href      string `xml:"href,attr"`
	MediaType string `xml:"media-type,attr"`
}

type ItemRef

type ItemRef struct {
	IdRef  string `xml:"idref,attr"`
	Linear string `xml:"linear,attr"`
}

type Manifest

type Manifest struct {
	Items []Item `xml:"item"`
}

type Metadata

type Metadata struct {
	Title      string `xml:"title"`
	Creator    string `xml:"creator"`
	Language   string `xml:"language"`
	Identifier string `xml:"identifier"`
	Subject    string `xml:"subject"`
	Publisher  string `xml:"publisher"`
	Date       string `xml:"date"`
}

type Opf

type Opf struct {
	XMLName  xml.Name `xml:"package"`
	Metadata Metadata `xml:"metadata"`
	Manifest Manifest `xml:"manifest"`
	Spine    Spine    `xml:"spine"`
}

func (*Opf) Cover

func (p *Opf) Cover() Item

func (*Opf) Index

func (p *Opf) Index() Item

type RootFile

type RootFile struct {
	FullPath  string `xml:"full-path,attr"`
	MediaType string `xml:"media-type,attr"`
	Opf       *Opf
}

type Spine

type Spine struct {
	Toc      string    `xml:"toc,attr"`
	ItemRefs []ItemRef `xml:"itemref"`
}

type WalkFunc

type WalkFunc func(name string) error

Jump to

Keyboard shortcuts

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