Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RepoStats ¶
type RepoStats struct {
Repo string `json:"repo"`
MatchCount int `json:"match_count"`
FileCount int `json:"file_count"`
}
RepoStats holds per-repo match statistics.
type Result ¶
type Result struct {
Repo string `json:"repo"`
Path string `json:"path"`
Line int `json:"line"`
Column int `json:"column"`
ContextBefore []string `json:"context_before"`
ContextLine string `json:"context_line"`
ContextAfter []string `json:"context_after"`
Score float64 `json:"score"`
}
Result is a single code search match from peregrine.
type SearchRequest ¶
SearchRequest holds the parameters for a code search call to peregrine via the cell's entire-api gateway at GET /api/v1/search/api/search.
type SearchResponse ¶
type SearchResponse struct {
Query string `json:"query"`
Stats Stats `json:"stats"`
RepoStats []RepoStats `json:"repo_stats"`
Results []Result `json:"results"`
// FailedJurisdictions is set by the CLI's merge layer (not by peregrine)
// when one or more cells failed during multi-region fan-out.
FailedJurisdictions []string `json:"failed_jurisdictions,omitempty"`
}
SearchResponse is peregrine's code search response.
func Search ¶
func Search(ctx context.Context, client *api.Client, req SearchRequest) (*SearchResponse, error)
Search calls peregrine's code search endpoint through the cell's entire-api gateway: GET /api/v1/search/api/search?q=...&max_results=...&repo=... The client must already be authenticated against the cell.
Click to show internal directories.
Click to hide internal directories.