index

package
v0.0.0-...-b1b52ee Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseStatistics

type DatabaseStatistics struct {
	NumberOfFiles int `json:"number_of_files"`
	KeywordCount  int `json:"number_of_keywords"`
}

DatabaseStatistics contains some small statistic numbers from the amount of content in the system

type KeywordResult

type KeywordResult struct {
	BookID   string
	Filename string
}

KeywordResult is a single result, pointing to a BookID and a Filename inside this book which has the keyword

type Store

type Store struct {
	FileName string
	// contains filtered or unexported fields
}

Store is the store for keywords

func NewStore

func NewStore(prefix, ext, f1FragmentPattern string) *Store

NewStore creates a index store

func OldStore

func OldStore(file, f1FragmentPattern string) *Store

OldStore open a already existing index store

func (*Store) FetchIndex

func (i *Store) FetchIndex(book *types.Book)

FetchIndex downloads the index file, decodes it and requests it to be added to the store

func (*Store) GetStatistics

func (i *Store) GetStatistics() DatabaseStatistics

GetStatistics reads the statistics from the db storage and returns them

func (*Store) LookupKeyword

func (i *Store) LookupKeyword(keyword string) []KeywordResult

LookupKeyword looks up the keyword in the store, and returns a slice of KeywordResult

Jump to

Keyboard shortcuts

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