internal

package
v1.21.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilenameIndexerID

func FilenameIndexerID(repoID int64, filename string) string

func FilenameOfIndexerID

func FilenameOfIndexerID(indexerID string) string

func ParseIndexerID

func ParseIndexerID(indexerID string) (int64, string)

Types

type FileUpdate

type FileUpdate struct {
	Filename string
	BlobSha  string
	Size     int64
	Sized    bool
}

type Indexer

type Indexer interface {
	internal.Indexer
	Index(ctx context.Context, repo *repo_model.Repository, sha string, changes *RepoChanges) error
	Delete(ctx context.Context, repoID int64) error
	Search(ctx context.Context, repoIDs []int64, language, keyword string, page, pageSize int, isMatch bool) (int64, []*SearchResult, []*SearchResultLanguages, error)
}

Indexer defines an interface to index and search code contents

func NewDummyIndexer

func NewDummyIndexer() Indexer

NewDummyIndexer returns a dummy indexer

type IndexerData

type IndexerData struct {
	RepoID int64
}

IndexerData represents data stored in the code indexer

type RepoChanges

type RepoChanges struct {
	Updates          []FileUpdate
	RemovedFilenames []string
}

RepoChanges changes (file additions/updates/removals) to a repo

type SearchResult

type SearchResult struct {
	RepoID      int64
	StartIndex  int
	EndIndex    int
	Filename    string
	Content     string
	CommitID    string
	UpdatedUnix timeutil.TimeStamp
	Language    string
	Color       string
}

SearchResult result of performing a search in a repo

type SearchResultLanguages

type SearchResultLanguages struct {
	Language string
	Color    string
	Count    int
}

SearchResultLanguages result of top languages count in search results

Jump to

Keyboard shortcuts

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