indexer

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: MIT Imports: 15 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 added in v1.3.0

func DeleteRepoFromIndexer(repoID int64) error

DeleteRepoFromIndexer delete all of a repo's files from indexer

func InitIssueIndexer added in v1.3.0

func InitIssueIndexer(populateIndexer func() error)

InitIssueIndexer initialize issue indexer

func InitRepoIndexer added in v1.3.0

func InitRepoIndexer(populateIndexer func() error)

InitRepoIndexer initialize repo indexer

func SearchIssuesByKeyword added in v1.3.0

func SearchIssuesByKeyword(repoID int64, keyword string) ([]int64, error)

SearchIssuesByKeyword searches for issues by given conditions. Returns the matching issue IDs

Types

type Batch added in v1.3.0

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

Batch batch of indexer updates that automatically flushes once it reaches a certain size

func IssueIndexerBatch added in v1.3.0

func IssueIndexerBatch() *Batch

IssueIndexerBatch batch to add updates to

func RepoIndexerBatch added in v1.3.0

func RepoIndexerBatch() *Batch

RepoIndexerBatch batch to add updates to

func (*Batch) Add added in v1.3.0

func (batch *Batch) Add(update Update) error

Add add update to batch, possibly flushing

func (*Batch) Flush added in v1.3.0

func (batch *Batch) Flush() error

Flush manually flush the batch, regardless of its size

type IssueIndexerData added in v1.3.0

type IssueIndexerData struct {
	RepoID   int64
	Title    string
	Content  string
	Comments []string
}

IssueIndexerData data stored in the issue indexer

type IssueIndexerUpdate added in v1.3.0

type IssueIndexerUpdate struct {
	IssueID int64
	Data    *IssueIndexerData
}

IssueIndexerUpdate an update to the issue indexer

type RepoIndexerData added in v1.3.0

type RepoIndexerData struct {
	RepoID  int64
	Content string
}

RepoIndexerData data stored in the repo indexer

type RepoIndexerOp added in v1.3.0

type RepoIndexerOp int

RepoIndexerOp type of operation to perform on repo indexer

type RepoIndexerUpdate added in v1.3.0

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

RepoIndexerUpdate an update to the repo indexer

type RepoSearchResult added in v1.3.0

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

RepoSearchResult result of performing a search in a repo

func SearchRepoByKeyword added in v1.3.0

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

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

type Update added in v1.3.0

type Update interface {
	// contains filtered or unexported methods
}

Update represents an update to an indexer

Jump to

Keyboard shortcuts

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