entities

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IndexFieldSep = "; "
)

Functions

func NewBookIndexMapping

func NewBookIndexMapping() *mapping.IndexMappingImpl

Types

type BookIndex

type BookIndex struct {
	Year             uint16
	Offset           uint64
	SizeCompressed   uint64
	SizeUncompressed uint64
	ID               string
	Lang             string
	Src              string
	ISBN             string
	Titles           string
	Authors          string
	Sequences        string
	Publisher        string
	Date             string
	Genres           string
}

func NewBookIndex

func NewBookIndex(fb2 *fb2parser.FB2File) BookIndex

type CntAtomic32

type CntAtomic32 uint32

func (*CntAtomic32) Inc

func (c *CntAtomic32) Inc(delta uint32) uint32

func (*CntAtomic32) Total

func (c *CntAtomic32) Total() uint32

type FB2Book

type FB2Book struct {
	Description struct {
		fb2parser.FB2Description
		TitleInfo    FB2TitleInfo  `xml:"title-info"`
		SrcTitleInfo *FB2TitleInfo `xml:"src-title-info"`
	} `xml:"description"`
	Binary []struct {
		ID   string `xml:"id,attr"`
		Type string `xml:"content-type,attr"`
		Data string `xml:",innerxml"`
	} `xml:"binary"`
}

type FB2CoverPage

type FB2CoverPage struct {
	Images []struct {
		Href string `xml:"href,attr"`
	} `xml:"image"`
}

type FB2TitleInfo

type FB2TitleInfo struct {
	fb2parser.FB2TitleInfo
	Coverpage *FB2CoverPage `xml:"coverpage"`
}

type IBooksDataRepo

type IBooksDataRepo interface {
	GetFor(BookIndex) (FB2Book, error)
}

type IBooksIndexRepo

type IBooksIndexRepo interface {
	SearchAll(string, pagination.IPager) ([]BookIndex, error)
	SearchByAuthor(string, pagination.IPager) ([]BookIndex, error)
	SearchBySequence(string, pagination.IPager) ([]BookIndex, error)
	GetBook(string) (BookIndex, error)
}

type IIndexFactory

type IIndexFactory func(string) (bleve.Index, error)

type ISearchIndex

type ISearchIndex interface {
	io.Closer
	DocCount() (uint64, error)
	Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
	Index(id string, data interface{}) error
	Name() string
	NewBatch() *bleve.Batch
	Batch(b *bleve.Batch) error
}

Jump to

Keyboard shortcuts

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