Documentation
¶
Index ¶
- Constants
- func BuildBookName(book BookIndex) (res string)
- func BuildBookURL(path, urlPrefix, pathPrefix string) string
- func GenerateID(args ...[]string) string
- func GetFirstStr(items []string) string
- func NewBookIndexMapping() *mapping.IndexMappingImpl
- func ParseFB2(reader io.Reader, encoder LibEncodeType, rules ...fb2parse.HandlingRule) (res fb2parse.FB2File, err error)
- func ParseYear(date string) (res uint16)
- func SliceHasString(haystack []string, needle string) bool
- func TransformStr(val string) string
- type BookIndex
- type BookInfo
- type CntAtomic32
- type GenreFreq
- type GenresIndex
- type IBooksInfoRepo
- type IBooksLibraryRepo
- type ILibMarksRepo
- type IMarshal
- type ISearchIndex
- type IUnmarshal
- type LibEncodeType
- type LibItem
- type Libraries
- type Library
Constants ¶
View Source
const ( IndexFieldSep = "; " IdxFieldYear = "year" IdxFieldISBN = "isbn" IdxFieldTitle = "title" IdxFieldAuthor = "author" IdxFieldTranslator = "transl" IdxFieldSerie = "serie" IdxFieldDate = "date" IdxFieldGenre = "genre" IdxFieldPublisher = "publ" IdxFieldLang = "lang" IdxFieldLib = "lib" )
Variables ¶
This section is empty.
Functions ¶
func BuildBookName ¶ added in v1.12.0
func BuildBookURL ¶ added in v1.12.0
func GenerateID ¶ added in v1.12.0
func GetFirstStr ¶ added in v1.12.0
func NewBookIndexMapping ¶
func NewBookIndexMapping() *mapping.IndexMappingImpl
func ParseFB2 ¶ added in v1.12.0
func ParseFB2(reader io.Reader, encoder LibEncodeType, rules ...fb2parse.HandlingRule, ) (res fb2parse.FB2File, err error)
func SliceHasString ¶ added in v1.12.0
func TransformStr ¶ added in v1.12.0
Types ¶
type BookIndex ¶
type BookIndex struct {
Year uint16 `json:"year"`
ID string
ISBN string `json:"isbn"`
Title string `json:"title"`
Author string `json:"author"`
Translator string `json:"transl"`
Serie string `json:"serie"`
Date string `json:"date"`
Genre string `json:"genre"`
Publisher string `json:"publ"`
Lang string `json:"lang"`
Lib string `json:"lib"`
}
func NewBookIndex ¶
func NewBookIndex(match *search.DocumentMatch) BookIndex
func NewFB2Index ¶ added in v1.12.0
type BookInfo ¶ added in v1.12.0
type BookInfo struct {
Offset uint64 `json:"from"`
Size uint64 `json:"size"`
SizeCompressed uint64 `json:"sizec"`
LibName string `json:"lib"`
Src string `json:"src"`
Index BookIndex `json:"-"`
Details struct {
Images []fb2parse.FB2Binary
Annotation string
} `json:"-"`
}
func (*BookInfo) ReadDetails ¶ added in v1.12.0
type CntAtomic32 ¶
type CntAtomic32 uint32
func (*CntAtomic32) Inc ¶
func (c *CntAtomic32) Inc(delta uint32) uint32
func (*CntAtomic32) Total ¶
func (c *CntAtomic32) Total() uint32
type GenresIndex ¶ added in v1.13.0
type GenresIndex []GenreFreq
func (GenresIndex) Len ¶ added in v1.13.0
func (g GenresIndex) Len() int
func (GenresIndex) Less ¶ added in v1.13.0
func (g GenresIndex) Less(i, j int) bool
func (GenresIndex) Swap ¶ added in v1.13.0
func (g GenresIndex) Swap(i, j int)
type IBooksInfoRepo ¶ added in v1.12.0
type IBooksInfoRepo interface {
io.Closer
GetItems(query.Query, pagination.IPager, []search.SearchSort, *bleve.HighlightRequest, ...string) ([]BookInfo, error)
FindByID(string) (BookInfo, error)
FindBooks(queryStr, tagName, tagValue string, pager pagination.IPager) ([]BookInfo, error)
SaveBook(BookInfo) error
GetGenres(pagination.IPager) (GenresIndex, error)
Remove(string) error
GetSeriesBooks(string, *BookInfo) ([]BookInfo, error)
GetOtherAuthorBooks(string, *BookInfo) ([]BookInfo, error)
GetOtherAuthorSeries(authors, curSeries string) (map[string]int, error)
GetStats() (map[string]uint64, error)
GetSeriesByLetter(string) ([]string, error)
GetAuthorsByLetter(string) ([]string, error)
}
type IBooksLibraryRepo ¶ added in v1.12.0
type ILibMarksRepo ¶ added in v1.12.0
type ISearchIndex ¶
type IUnmarshal ¶ added in v1.12.0
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.