Documentation
¶
Index ¶
- func BuildBookName(book *Book) (res string)
- func BuildBookURL(path, urlPrefix, pathPrefix string) string
- func NewBookIndexMapping() *mapping.IndexMappingImpl
- func ParseFB2(reader io.Reader, encoder LibEncodeType, rules ...xmlparse.Rule) (res fb2.File, err error)
- func ParseYear(date string) (res uint16)
- func SliceHasString(haystack []string, needle string) bool
- func TransformStr(vals ...string) string
- type Book
- type BookIndex
- type BookMeta
- type BookPublisher
- type BreadCrumb
- type BreadCrumbs
- type CntAtomic32
- type FreqsItems
- type IBooksInfoRepo
- type IBooksLibraryRepo
- type IMarshal
- type ISearchIndex
- type IUnmarshal
- type IndexField
- type IndexRules
- type ItemFreq
- type ItemFreqMap
- type LibEncodeType
- type LibItem
- type Libraries
- type Library
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBookName ¶ added in v1.12.0
func BuildBookURL ¶ added in v1.12.0
func NewBookIndexMapping ¶
func NewBookIndexMapping() *mapping.IndexMappingImpl
func SliceHasString ¶ added in v1.12.0
func TransformStr ¶ added in v1.12.0
Types ¶
type Book ¶ added in v1.14.0
type Book struct {
ID string `json:"id"`
Offset uint64 `json:"from,omitempty"`
Size uint64 `json:"size,omitempty"`
SizeCompressed uint64 `json:"sizec,omitempty"`
Lib string `json:"lib,omitempty"`
Src string `json:"src,omitempty"`
Info BookMeta `json:"info,omitempty"`
OrigInfo *BookMeta `json:"oinfo,omitempty"`
PublInfo []BookPublisher `json:"pinfo,omitempty"`
Match map[string]string `json:"-"`
}
func (*Book) Translators ¶ added in v1.14.0
type BookIndex ¶
type BookIndex struct {
ID string `json:"id,omitempty"`
Year uint16 `json:"year,omitempty"`
ISBN string `json:"isbn,omitempty"`
Title string `json:"title,omitempty"`
Author string `json:"auth,omitempty"`
Translator string `json:"transl,omitempty"`
Serie string `json:"seq,omitempty"`
Date string `json:"date,omitempty"`
Genre string `json:"genre,omitempty"`
Publisher string `json:"publ,omitempty"`
Lang string `json:"lng,omitempty"`
Keywords string `json:"kwds,omitempty"`
Lib string `json:"lib,omitempty"`
}
type BookMeta ¶ added in v1.14.0
type BookMeta struct {
Annotation string `json:"annot,omitempty"`
Lang string `json:"lang,omitempty"`
SrcLang string `json:"slang,omitempty"`
Title string `json:"title,omitempty"`
Keywords string `json:"kwds,omitempty"`
Date string `json:"date,omitempty"`
Genres []string `json:"genres,omitempty"`
Authors []string `json:"auth,omitempty"`
Translators []string `json:"transl,omitempty"`
Sequences []string `json:"seq,omitempty"`
CoverID string `json:"cover,omitempty"`
Cover *fb2.Binary `json:"-"`
}
type BookPublisher ¶ added in v1.14.0
type BookPublisher struct {
Title string `json:"title,omitempty"`
Publisher string `json:"publ,omitempty"`
Year string `json:"year,omitempty"`
ISBN string `json:"isbn,omitempty"`
Authors []string `json:"auth,omitempty"`
Sequences []string `json:"seqs,omitempty"`
}
func NewBookPublisher ¶ added in v1.14.0
func NewBookPublisher(data fb2.Publisher) (res BookPublisher)
type BreadCrumb ¶ added in v1.14.0
type BreadCrumbs ¶ added in v1.14.0
type BreadCrumbs []BreadCrumb
func (BreadCrumbs) Push ¶ added in v1.14.0
func (b BreadCrumbs) Push(title, link string) BreadCrumbs
type CntAtomic32 ¶
type CntAtomic32 uint32
func (*CntAtomic32) Inc ¶
func (c *CntAtomic32) Inc(delta uint32) uint32
func (*CntAtomic32) Total ¶
func (c *CntAtomic32) Total() uint32
type FreqsItems ¶ added in v1.14.0
type FreqsItems []ItemFreq
func (FreqsItems) Len ¶ added in v1.14.0
func (g FreqsItems) Len() int
func (FreqsItems) Less ¶ added in v1.14.0
func (g FreqsItems) Less(i, j int) bool
func (FreqsItems) Swap ¶ added in v1.14.0
func (g FreqsItems) Swap(i, j int)
type IBooksInfoRepo ¶ added in v1.12.0
type IBooksInfoRepo interface {
io.Closer
GetByID(bookID string) (*Book, error)
FindBooks(queryStr string, idxField IndexField, idxFieldVal string, pager pagination.IPager) ([]Book, error)
Remove(bookID string) error
GetSeriesBooks(limit int, series []string, except *Book) (res []Book, err error)
GetAuthorsBooks(limit int, authors []string, except *Book) (res []Book, err error)
GetAuthorsSeries(authors []string, except []string) (res map[string]int, err error)
GetBooksCnt() (uint64, error)
GetAuthorsCnt() (uint64, error)
GetGenresCnt() (uint64, error)
GetSeriesCnt() (uint64, error)
GetGenres(pager pagination.IPager) (FreqsItems, error)
GetSeriesByChar(char rune) (FreqsItems, error)
GetAuthorsByChar(char rune) (FreqsItems, error)
SaveBook(book *Book) error
}
type IBooksLibraryRepo ¶ added in v1.12.0
type ISearchIndex ¶
type IUnmarshal ¶ added in v1.12.0
type IndexField ¶ added in v1.14.0
type IndexField string
const ( IdxFUndefined IndexField = "" IdxFID IndexField = "id" IdxFYear IndexField = "year" IdxFISBN IndexField = "isbn" IdxFTitle IndexField = "title" IdxFAuthor IndexField = "auth" IdxFTranslator IndexField = "transl" IdxFSerie IndexField = "seq" IdxFDate IndexField = "date" IdxFGenre IndexField = "genre" IdxFPublisher IndexField = "publ" IdxFLang IndexField = "lng" IdxFKeywords IndexField = "kwds" IdxFLib IndexField = "lib" )
type IndexRules ¶ added in v1.14.0
func NewIndexRules ¶ added in v1.14.0
func NewIndexRules(cfgKey string, cfg *viper.Viper) (res IndexRules, err error)
func (IndexRules) Check ¶ added in v1.14.0
func (r IndexRules) Check(book *Book) error
type ItemFreqMap ¶ added in v1.14.0
func (ItemFreqMap) Put ¶ added in v1.14.0
func (m ItemFreqMap) Put(val string, freq int)
type LibEncodeType ¶ added in v1.12.0
type LibEncodeType string
const ( LibEncodeMarshaler LibEncodeType = "marshaler" LibEncodeParser LibEncodeType = "parser" )
type Libraries ¶ added in v1.12.0
func NewLibraries ¶ added in v1.12.0
Click to show internal directories.
Click to hide internal directories.