code

package
v1.22.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 23 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init initialize the repo indexer

func IsAvailable added in v1.17.0

func IsAvailable(ctx context.Context) bool

IsAvailable checks if issue indexer is available

func PerformSearch

func PerformSearch(ctx context.Context, opts *SearchOptions) (int, []*Result, []*SearchResultLanguages, error)

PerformSearch perform a search on a repository if isFuzzy is true set the Damerau-Levenshtein distance from 0 to 2

func UpdateRepoIndexer

func UpdateRepoIndexer(repo *repo_model.Repository)

UpdateRepoIndexer update a repository's entries in the indexer

Types

type Result

type Result struct {
	RepoID      int64
	Filename    string
	CommitID    string
	UpdatedUnix timeutil.TimeStamp
	Language    string
	Color       string
	Lines       []ResultLine
}

Result a search result to display

type ResultLine added in v1.21.8

type ResultLine struct {
	Num              int
	FormattedContent template.HTML
}

func HighlightSearchResultCode added in v1.22.0

func HighlightSearchResultCode(filename string, lineNums []int, code string) []ResultLine

type SearchOptions added in v1.22.0

type SearchOptions = internal.SearchOptions

type SearchResultLanguages added in v1.12.0

type SearchResultLanguages = internal.SearchResultLanguages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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