engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *lecho.Logger

Logger is global since we will need it everywhere

Functions

func DeleteFile

func DeleteFile(filePath string) error

DeleteFile deletes a folder (or file) and everything in that folder

func ParseSearchResults

func ParseSearchResults(results *bleve.SearchResult, db *storm.DB) ([]database.Document, error)

ParseSearchResults takes a result of any search and gets the document ID's, pulls the files from the database and sends them back

func SearchExactPhrase

func SearchExactPhrase(phrase string, index bleve.Index) (*bleve.SearchResult, error)

SearchExactPhrase is used to search using multiple words instead of just one word //TODO implement frontend support for exact phrase

func SearchExactSingleTerm

func SearchExactSingleTerm(term string, index bleve.Index) (*bleve.SearchResult, error)

SearchExactSingleTerm searches for just one word //TODO implement frontend support for exact term

func SearchGeneralPhrase

func SearchGeneralPhrase(phrase string, index bleve.Index) (*bleve.SearchResult, error)

SearchGeneralPhrase is a "fuzzy" search that is very inclusive

Types

type ServerHandler

type ServerHandler struct {
	DB           *storm.DB
	SearchDB     bleve.Index
	Echo         *echo.Echo
	ServerConfig config.ServerConfig
}

ServerHandler will inject the variables needed into routes

func (*ServerHandler) AddDocumentViewRoutes

func (serverHandler *ServerHandler) AddDocumentViewRoutes() error

AddDocumentViewRoutes adds all of the current documents to an echo route

func (*ServerHandler) CreateFolder

func (serverHandler *ServerHandler) CreateFolder(context echo.Context) error

CreateFolder creates a folder in the document tree

func (*ServerHandler) DeleteFile

func (serverHandler *ServerHandler) DeleteFile(context echo.Context) error

DeleteFile deletes a folder or file from the database (and all children if folder) (and on disc and from bleve search if document)

func (*ServerHandler) GetDocument

func (serverHandler *ServerHandler) GetDocument(context echo.Context) error

GetDocument will return a document by ULID

func (*ServerHandler) GetDocumentFileSystem

func (serverHandler *ServerHandler) GetDocumentFileSystem(context echo.Context) error

GetDocumentFileSystem will scan the document folder and get the complete tree to send to the frontend

func (*ServerHandler) GetFolder

func (serverHandler *ServerHandler) GetFolder(context echo.Context) error

GetFolder fetches all the documents in the folder

func (*ServerHandler) GetLatestDocuments

func (serverHandler *ServerHandler) GetLatestDocuments(context echo.Context) error

GetLatestDocuments gets the latest documents that were ingressed

func (*ServerHandler) InitializeSchedules

func (serverHandler *ServerHandler) InitializeSchedules(db *storm.DB, searchDB bleve.Index)

InitializeSchedules starts all the cron jobs (currently just one)

func (*ServerHandler) MoveDocuments

func (serverHandler *ServerHandler) MoveDocuments(context echo.Context) error

MoveDocuments will accept an API call from the frontend to move a document or documents

func (*ServerHandler) SearchDocuments

func (serverHandler *ServerHandler) SearchDocuments(context echo.Context) error

SearchDocuments will take the search terms and search all documents

func (*ServerHandler) StartupChecks

func (serverHandler *ServerHandler) StartupChecks() error

StartupChecks performs all the checks to make sure everything works

func (*ServerHandler) UploadDocuments

func (serverHandler *ServerHandler) UploadDocuments(context echo.Context) error

UploadDocuments handles documents uploaded from the frontend

Jump to

Keyboard shortcuts

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