fb2

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fb2 contains entities for fb2-files parsing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	HTML string `xml:",innerxml"`
}

Annotation struct of fb2 annotation. http://www.fictionbook.org/index.php/Элемент_annotation

func NewAnnotation

func NewAnnotation(tokenName string, reader xmlparse.TokenReader) (res Annotation, err error)

NewAnnotation factory for Annotation.

type Author

type Author struct {
	FirstName  []string `xml:"first-name"`
	MiddleName []string `xml:"middle-name"`
	LastName   []string `xml:"last-name"`
	Nickname   []string `xml:"nickname"`
	HomePage   []string `xml:"home-page"`
	Email      []string `xml:"email"`
	ID         []string `xml:"id"`
}

Author struct of fb2 author. http://www.fictionbook.org/index.php/Элемент_author

func NewAuthor

func NewAuthor(tokenName string, reader xmlparse.TokenReader) (res Author, err error)

NewAuthor factory for Author.

func (Author) String added in v1.1.1

func (a Author) String() string

type Binary

type Binary struct {
	ContentType string `xml:"content-type,attr"`
	ID          string `xml:"id,attr"`
	Data        string `xml:",innerxml"`
}

Binary struct of fb2 binary data. http://www.fictionbook.org/index.php/Элемент_binary

func NewBinary

func NewBinary(token xml.StartElement, reader xmlparse.TokenReader) (res Binary, err error)

NewBinary factory for Binary.

type Body

type Body struct {
	HTML string `xml:",innerxml"`
}

Body struct of fb2 body. http://www.fictionbook.org/index.php/Элемент_body

func NewBody

func NewBody(tokenName string, reader xmlparse.TokenReader) (res Body, err error)

NewBody factory for Body.

type Cover

type Cover struct {
	Images []Image `xml:"image"`
}

Cover struct of fb2 cover page. http://www.fictionbook.org/index.php/Элемент_coverpage

func NewCover

func NewCover(tokenName string, reader xmlparse.TokenReader) (res Cover, err error)

NewCover factory for Cover.

type CustomInfo

type CustomInfo struct {
	InfoType string `xml:"info-type,attr"`
	Data     string `xml:",innerxml"`
}

CustomInfo struct of fb2 custom info. http://www.fictionbook.org/index.php/Элемент_custom-info

func NewCustomInfo

func NewCustomInfo(token xml.StartElement, reader xmlparse.TokenReader) (res CustomInfo, err error)

NewCustomInfo factory for CustomInfo.

type Description

type Description struct {
	TitleInfo    []TitleInfo  `xml:"title-info"`
	SrcTitleInfo []TitleInfo  `xml:"src-title-info"`
	DocInfo      []DocInfo    `xml:"document-info"`
	PublishInfo  []Publisher  `xml:"publish-info"`
	CustomInfo   []CustomInfo `xml:"custom-info"`
}

Description struct of fb2 description. http://www.fictionbook.org/index.php/Элемент_description

func NewDescription

func NewDescription(
	tokenName string, reader xmlparse.TokenReader, rules []xmlparse.Rule,
) (res Description, err error)

NewDescription factory for Description.

type DocInfo

type DocInfo struct {
	Authors    []Author `xml:"author"`
	SrcURL     []string `xml:"src-url"`
	ID         []string `xml:"id"`
	Version    []string `xml:"version"`
	Publishers []Author `xml:"publisher"`
}

DocInfo struct of fb2 document info. http://www.fictionbook.org/index.php/Элемент_document-info

func NewDocInfo

func NewDocInfo(
	tokenName string, reader xmlparse.TokenReader, rules []xmlparse.Rule,
) (res DocInfo, err error)

NewDocInfo factory for NewDocInfo.

type File

type File struct {
	Description []Description `xml:"description"`
	// Body        []Body      `xml:"body"`
	Binary []Binary `xml:"binary"`
}

File struct of fb2 file. http://www.fictionbook.org/index.php/Элемент_FictionBook http://www.fictionbook.org/index.php/Описание_формата__от_Sclex

func NewFile

func NewFile(reader xmlparse.TokenReader, rules ...xmlparse.Rule) (res File, err error)

NewFile factory for File.

type Image

type Image struct {
	Type  string `xml:"type,attr"`
	Href  string `xml:"href,attr"`
	Alt   string `xml:"alt,attr"`
	Title string `xml:"title,attr"`
	ID    string `xml:"id,attr"`
}

Image struct of fb2 image. http://www.fictionbook.org/index.php/Элемент_image

func NewImage

func NewImage(token xml.StartElement) (res Image)

NewImage factory for Image.

type Publisher

type Publisher struct {
	BookAuthor []string   `xml:"book-author"`
	BookName   []string   `xml:"book-name"`
	Publisher  []string   `xml:"publisher"`
	City       []string   `xml:"city"`
	Year       []string   `xml:"year"`
	ISBN       []string   `xml:"isbn"`
	Sequence   []Sequence `xml:"sequence"`
}

Publisher struct of fb2 publisher info. http://www.fictionbook.org/index.php/Элемент_publish-info

func NewPublisher

func NewPublisher(
	tokenName string, reader xmlparse.TokenReader, rules []xmlparse.Rule,
) (res Publisher, err error)

NewPublisher factory for Publisher.

func (Publisher) String added in v1.1.1

func (p Publisher) String() string

type Sequence

type Sequence struct {
	Number string `xml:"number,attr"`
	Name   string `xml:"name,attr"`
}

Sequence struct of fb2 sequence info. http://www.fictionbook.org/index.php/Элемент_sequence

func NewSequence

func NewSequence(token xml.StartElement) (res Sequence, err error)

NewSequence factory for Sequence.

func (Sequence) String added in v1.1.1

func (s Sequence) String() string

type TitleInfo

type TitleInfo struct {
	Genre      []string     `xml:"genre"`
	Author     []Author     `xml:"author"`
	BookTitle  []string     `xml:"book-title"`
	Annotation []Annotation `xml:"annotation"`
	Keywords   []string     `xml:"keywords"`
	Date       []string     `xml:"date"`
	Coverpage  []Cover      `xml:"coverpage"`
	Lang       []string     `xml:"lang"`
	SrcLang    []string     `xml:"src-lang"`
	Translator []Author     `xml:"translator"`
	Sequence   []Sequence   `xml:"sequence"`
}

TitleInfo struct of fb2 title info. http://www.fictionbook.org/index.php/Элемент_title-info

func NewTitleInfo

func NewTitleInfo(
	tokenName string, reader xmlparse.TokenReader, rules []xmlparse.Rule,
) (res TitleInfo, err error)

NewTitleInfo factory for TitleInfo.

Jump to

Keyboard shortcuts

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