indexer

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RepoIndexerOpUpdate add/update a file's contents
	RepoIndexerOpUpdate = iota

	// RepoIndexerOpDelete delete a file
	RepoIndexerOpDelete
)

Variables

This section is empty.

Functions

func DeleteRepoFromIndexer

func DeleteRepoFromIndexer(repoID int64) error

DeleteRepoFromIndexer delete all of a repo's files from indexer

func InitRepoIndexer

func InitRepoIndexer(populateIndexer func() error)

InitRepoIndexer initialize repo indexer

func RepoIndexerBatch

func RepoIndexerBatch() rupture.FlushingBatch

RepoIndexerBatch batch to add updates to

Types

type RepoIndexerData

type RepoIndexerData struct {
	RepoID  int64
	Content string
}

RepoIndexerData data stored in the repo indexer

func (*RepoIndexerData) Type

func (d *RepoIndexerData) Type() string

Type returns the document type, for bleve's mapping.Classifier interface.

type RepoIndexerOp

type RepoIndexerOp int

RepoIndexerOp type of operation to perform on repo indexer

type RepoIndexerUpdate

type RepoIndexerUpdate struct {
	Filepath string
	Op       RepoIndexerOp
	Data     *RepoIndexerData
}

RepoIndexerUpdate an update to the repo indexer

func (RepoIndexerUpdate) AddToFlushingBatch

func (update RepoIndexerUpdate) AddToFlushingBatch(batch rupture.FlushingBatch) error

AddToFlushingBatch adds the update to the given flushing batch.

type RepoSearchResult

type RepoSearchResult struct {
	RepoID     int64
	StartIndex int
	EndIndex   int
	Filename   string
	Content    string
}

RepoSearchResult result of performing a search in a repo

func SearchRepoByKeyword

func SearchRepoByKeyword(repoIDs []int64, keyword string, page, pageSize int) (int64, []*RepoSearchResult, error)

SearchRepoByKeyword searches for files in the specified repo. Returns the matching file-paths

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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