opf

package
v0.0.0-...-99fd3eb Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

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

Item is the manifest item structure

type Manifest

type Manifest struct {
	XMLName xml.Name
	Items   []Item `xml:"http://www.idpf.org/2007/opf item"`
}

Manifest is the package manifest structure

func (Manifest) ItemWithPath

func (m Manifest) ItemWithPath(path string) (Item, bool)

ItemWithPath looks for the manifest item corresponding to a given path

type Meta

type Meta struct {
	Name    string `xml:"name,attr"`
	Content string `xml:"content,attr"`
}

Meta is the metadata item structure

type Metadata

type Metadata struct {
	Author string `json:"author" xml:"http://purl.org/dc/elements/1.1/ creator"`
	Title  string `json:"title" xml:"http://purl.org/dc/elements/1.1/ title"`
	Isbn   string `json:"isbn" xml:"http://purl.org/dc/elements/1.1/ identifier"`
	Metas  []Meta `xml:"http://www.idpf.org/2007/opf meta"`
	Cover  string `json:"cover"`
}

Metadata is the package metadata structure

type Package

type Package struct {
	BasePath string   `xml:"-"`
	Metadata Metadata `xml:"http://www.idpf.org/2007/opf metadata"`
	Manifest Manifest `xml:"http://www.idpf.org/2007/opf manifest"`
}

Package is the main opf structure

func Parse

func Parse(r io.Reader) (Package, error)

Parse parses the opf xml struct and returns a Package object

Jump to

Keyboard shortcuts

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