epub

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: BSD-2-Clause Imports: 6 Imported by: 3

README

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.

epub package offers also a minimal tool to print to the standard output the metadata of the given epub file.

INSTALLATION

Everything should work fine using go standard commands (build, get, install...).

To install the metadata reading utility, run go install ./cmd/epub.

USAGE

Running godoc should give you helpful guideines on availbales features.

Metadata reading utility usage is straitforward, just type epub <epub>, where '' is the path to the epub file you want to read metadata from.

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 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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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