genres

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ALT_GENRES_XML = `` /* 39131-byte string literal not displayed */
View Source
const GENRES_XML = `` /* 72246-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Genre

type Genre struct {
	Value        string      `xml:"value,attr"`
	Descriptions []RootDescr `xml:"root-descr"`
	Subgenres    []Subgenre  `xml:"subgenres>subgenre"`
}

type GenreAlt

type GenreAlt struct {
	Value  string `xml:"value,attr"`
	Format string `xml:"format,attr"`
}

type GenreDescr

type GenreDescr struct {
	Lang  string `xml:"lang,attr"`
	Title string `xml:"title,attr"`
}

type GenresTree

type GenresTree struct {
	XMLName xml.Name `xml:"fbgenrestransfer"`
	Genres  []Genre  `xml:"genre"`
}

func NewGenresTree

func NewGenresTree(treeFile string) *GenresTree

func (*GenresTree) GenreName

func (gt *GenresTree) GenreName(genre, lang string) string

func (*GenresTree) ListGenres

func (gt *GenresTree) ListGenres() []Genre

func (*GenresTree) ListSubGenres

func (gt *GenresTree) ListSubGenres(genre string) []Subgenre

func (*GenresTree) Refine added in v1.0.0

func (gt *GenresTree) Refine(b *model.Book)

func (*GenresTree) String

func (gt *GenresTree) String() string

func (*GenresTree) SubgenreName

func (gt *GenresTree) SubgenreName(sg *Subgenre, lang string) string

type RootDescr

type RootDescr struct {
	Lang     string `xml:"lang,attr"`
	Title    string `xml:"genre-title,attr"`
	Detailed string `xml:"detailed,attr"`
}

type Subgenre

type Subgenre struct {
	Value        string       `xml:"value,attr"`
	Descriptions []GenreDescr `xml:"genre-descr"`
	Alts         []GenreAlt   `xml:"genre-alt"`
}

Jump to

Keyboard shortcuts

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