codesearch

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchFileGlob

func MatchFileGlob(path, glob string) bool

MatchFileGlob is the exported wrapper for the package's glob matcher. Supports "*.go", "pkg/foo/**", and full-path globs.

Types

type SearchInput

type SearchInput struct {
	Root          string
	Pattern       string
	IsRegex       bool
	FileGlob      string
	ExcludeGlob   string
	Language      string
	ContextLines  int
	MaxResults    int
	CaseSensitive bool
}

SearchInput controls how code search is performed.

type SearchMatch

type SearchMatch struct {
	File    string   `json:"file"`
	Line    int      `json:"line"`
	Text    string   `json:"text"`
	Context []string `json:"context,omitempty"`
}

SearchMatch represents a single line match in a file.

func Search(ctx context.Context, input SearchInput) ([]SearchMatch, error)

Search scans all files in a repository for lines matching a pattern. It uses ingest.IngestRepo to collect files, then searches each file line by line.

Jump to

Keyboard shortcuts

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