Documentation ¶
Index ¶
- Constants
- func NewPage(id string, data []byte) page
- type Dao
- type FileSystemDao
- func (fs *FileSystemDao) Delete(pageID string) error
- func (fs *FileSystemDao) DeleteGlob(pattern string) error
- func (fs *FileSystemDao) Drop() error
- func (fs *FileSystemDao) Fetch(pageID string) ([]byte, error)
- func (fs *FileSystemDao) FetchGlob(pattern string) []string
- func (fs *FileSystemDao) Index(pageID, pageTitle string, pageData []byte) error
- func (fs *FileSystemDao) Insert(pageID string, pageData []byte) error
- func (fs *FileSystemDao) Query(query string) (*QueryResult, error)
- type MockDao
- type MongoDBDao
- func (mongo *MongoDBDao) Delete(id string) error
- func (mongo *MongoDBDao) DeleteGlob(pattern string) error
- func (mongo *MongoDBDao) Drop() error
- func (mongo *MongoDBDao) Fetch(id string) ([]byte, error)
- func (mongo *MongoDBDao) FetchGlob(pattern string) []string
- func (mongo *MongoDBDao) Index(id, title string, data []byte) error
- func (mongo *MongoDBDao) Insert(id string, data []byte) error
- func (mongo *MongoDBDao) Query(query string) (*QueryResult, error)
- type QueryMatch
- type QueryResult
- type SearchDB
Constants ¶
View Source
const ( TITLE = "title" MODIFIED = "modified" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileSystemDao ¶
type FileSystemDao struct { *SearchDB // contains filtered or unexported fields }
func NewFileSystemDao ¶
func (*FileSystemDao) Delete ¶
func (fs *FileSystemDao) Delete(pageID string) error
func (*FileSystemDao) DeleteGlob ¶
func (fs *FileSystemDao) DeleteGlob(pattern string) error
func (*FileSystemDao) Drop ¶
func (fs *FileSystemDao) Drop() error
func (*FileSystemDao) FetchGlob ¶
func (fs *FileSystemDao) FetchGlob(pattern string) []string
func (*FileSystemDao) Index ¶
func (fs *FileSystemDao) Index(pageID, pageTitle string, pageData []byte) error
func (*FileSystemDao) Insert ¶
func (fs *FileSystemDao) Insert(pageID string, pageData []byte) error
func (*FileSystemDao) Query ¶
func (fs *FileSystemDao) Query(query string) (*QueryResult, error)
type MockDao ¶
type MockDao struct { Dao // contains filtered or unexported fields }
MockDao should only be used for testing purposes
func NewMockDao ¶
type MongoDBDao ¶
type MongoDBDao struct { Session *mgo.Session Idx mgo.Index *SearchDB // contains filtered or unexported fields }
func NewMongoDBDao ¶
func NewMongoDBDao(connection string, searchDir string) (*MongoDBDao, error)
func (*MongoDBDao) Delete ¶
func (mongo *MongoDBDao) Delete(id string) error
func (*MongoDBDao) DeleteGlob ¶
func (mongo *MongoDBDao) DeleteGlob(pattern string) error
func (*MongoDBDao) Drop ¶
func (mongo *MongoDBDao) Drop() error
func (*MongoDBDao) FetchGlob ¶
func (mongo *MongoDBDao) FetchGlob(pattern string) []string
func (*MongoDBDao) Query ¶
func (mongo *MongoDBDao) Query(query string) (*QueryResult, error)
type QueryMatch ¶
type QueryResult ¶
type QueryResult struct { Phrase string Total uint64 Took float64 QueryMatches []QueryMatch }
func (*QueryResult) ToMap ¶
func (qr *QueryResult) ToMap() map[string]interface{}
Click to show internal directories.
Click to hide internal directories.