store

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const IndexPathsSettingKey = "index_paths"

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Path   string
	Slides []Slide
}

type SearchResult

type SearchResult struct {
	SlideId   string            `json:"slideId"`
	Slide     int               `json:"slide"`
	Path      string            `json:"path"`
	Thumbnail string            `json:"thumbnail"`
	Match     SearchResultMatch `json:"match"`
}

type SearchResultMatch

type SearchResultMatch struct {
	Text   string `json:"text"`
	Start  int    `json:"start"`
	Length int    `json:"length"`
}

type Slide

type Slide struct {
	SlideNumber     int
	ThumbnailBase64 string
	TextContent     string
}

type SlideNumberSorter

type SlideNumberSorter []Slide

func (SlideNumberSorter) Len

func (a SlideNumberSorter) Len() int

func (SlideNumberSorter) Less

func (a SlideNumberSorter) Less(i, j int) bool

func (SlideNumberSorter) Swap

func (a SlideNumberSorter) Swap(i, j int)

type SlideStore

type SlideStore interface {
	Search(query string) []SearchResult
	GetDocumentPathForSlideId(slideId string) string
	IsFileModified(path string, modifiedTime time.Time, fileSize int64) bool
	Save(document Document)
	GetIndexPaths() []string
	SetIndexPaths(paths []string)
}

type SqliteMemoryStore

type SqliteMemoryStore struct {
	// contains filtered or unexported fields
}

func NewSqliteStore

func NewSqliteStore() *SqliteMemoryStore

func (*SqliteMemoryStore) GetDocumentPathForSlideId

func (s *SqliteMemoryStore) GetDocumentPathForSlideId(slideId string) string

func (*SqliteMemoryStore) GetIndexPaths

func (s *SqliteMemoryStore) GetIndexPaths() []string

func (*SqliteMemoryStore) IsFileModified

func (s *SqliteMemoryStore) IsFileModified(path string, modifiedTime time.Time, fileSize int64) bool

func (*SqliteMemoryStore) Save

func (s *SqliteMemoryStore) Save(document Document)

func (*SqliteMemoryStore) Search

func (s *SqliteMemoryStore) Search(query string) []SearchResult

func (*SqliteMemoryStore) SetIndexPaths

func (s *SqliteMemoryStore) SetIndexPaths(paths []string)

Jump to

Keyboard shortcuts

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