epub

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

README

Forked from https://github.com/pirmd/epub

INTRODUCTION

epub package provides a way to retrieve stored metadata from epub files.

At this point of time only retrieveing of metadata is supported and compliance with epub format 3 or more is only partial.

USAGE

Running godoc should give you helpful guideines on availbales features.

CONTRIBUTION

If you feel like to contribute, just follow github guidelines on forking then send a pull request

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	FullName string `xml:",chardata"`
	FileAs   string `xml:"file-as,attr"`
	Role     string `xml:"role,attr"`
}

type Date

type Date struct {
	Stamp string `xml:",chardata"`
	Event string `xml:"event,attr"`
}

type Identifier

type Identifier struct {
	Value  string `xml:",chardata"`
	ID     string `xml:"id,attr"`
	Scheme string `xml:"scheme,attr"`
}

type Item added in v0.1.1

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

type Manifest added in v0.1.1

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

type Meta

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

type Metadata

type Metadata struct {
	Title       []string     `xml:"title"`
	Language    []string     `xml:"language"`
	Identifier  []Identifier `xml:"identifier"`
	Creator     []Author     `xml:"creator"`
	Subject     []string     `xml:"subject"`
	Description []string     `xml:"description"`
	Publisher   []string     `xml:"publisher"`
	Contributor []Author     `xml:"contributor"`
	Date        []Date       `xml:"date"`
	Type        []string     `xml:"type"`
	Format      []string     `xml:"format"`
	Source      []string     `xml:"source"`
	Relation    []string     `xml:"relation"`
	Coverage    []string     `xml:"coverage"`
	Rights      []string     `xml:"rights"`
	Meta        []*Meta      `xml:"meta"`
}

func GetMetadata

func GetMetadata(r readatSeeker) (*Metadata, error)

GetMetadata reads metadata from the given epub opened as a readatSeeker

func GetMetadataFromFile

func GetMetadataFromFile(path string) (*Metadata, error)

GetMetadataFromFile reads metadata from the given epub file

Jump to

Keyboard shortcuts

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