inpx

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 8 Imported by: 0

README

INPX parser

Library for reading .inpx collection files.

Example:

collection, err := inpx.Open("testdata/flibusta_fb2_local.inpx")
if err != nil {
    panic(err)
}
defer collection.Close()

for book := range collection.Stream() {
	fmt.Printf("%v\n", book)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	LastName   string
	FirstName  string
	MiddleName string
}

Author represents the names of author.

type Book

type Book struct {
	Authors       []Author
	Genres        []string
	Title         string
	Series        string
	SeriesNo      int
	File          File
	LibId         int
	Deleted       bool
	PublishedDate time.Time
	Language      string
}

Book represents a book record in library.

type File

type File struct {
	Name    string
	Size    int
	Ext     string
	Folder  string
	Archive string
}

File represents book file information.

type Parser

type Parser struct {
	Name    string
	Id      int
	Comment string
	Version string
	// contains filtered or unexported fields
}

Parser represents `.inpx` collection.

func Open

func Open(name string) (*Parser, error)

Open reads collection meta info and validates it.

func (*Parser) Close

func (p *Parser) Close()

Close underlying zip archive.

func (*Parser) Err

func (p *Parser) Err() error

Err returns the most recent decoder error if any, or nil.

func (*Parser) Stream

func (p *Parser) Stream() chan *Book

Stream begins parsing from the underlying reader and returns a streaming Book channel.

Jump to

Keyboard shortcuts

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