inpx

package module
v0.0.0-...-8ee18e1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2015 License: MIT Imports: 12 Imported by: 0

README

inpx

GoDoc

Inpx (book library archive) library for Go.

Documentation

Overview

Package inpx provides a set of methods to read .inpx files (book library index).

Index

Constants

View Source
const (
	FieldAuthor = iota
	FieldGenre
	FieldTitle
	FieldSeries
	FieldSeriesNum
	FieldFileName
	FieldFileSize
	FieldLibId
	FieldDeleted
	FieldExt
	FieldDate
	FieldLang
	FieldLibRate
	FieldKeywords
)

Known fields for inp files.

Variables

DefaultStructure is an inp file field order used by default.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name []string
}

Author describes an author.

type Book

type Book struct {
	Authors   []Author
	Genres    []string
	Title     string
	Series    string
	SeriesNum int
	File      File
	LibId     int
	Deleted   bool
	Date      time.Time
	Lang      string
}

Book describes a book in archive.

type File

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

File describes a book file in archive.

func (File) Open

func (fr File) Open() (io.ReadCloser, error)

Open opens a book file from archive.

type Index

type Index struct {
	Name     string
	Version  int
	Archives map[string][]Book
}

Index describes an inpx file information.

func Open

func Open(path string) (*Index, error)

Open reads whole library index from an inpx file.

func OpenWithStructure

func OpenWithStructure(path string, structure []int) (*Index, error)

OpenWithStructure reads whole library index from an inpx file using a provided field structure for individual inp files.

Jump to

Keyboard shortcuts

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