Documentation
¶
Overview ¶
Package search provides search functionality via the Entire search service.
Index ¶
Constants ¶
const AllReposFilter = "*"
AllReposFilter is the inline repo filter value that disables repo scoping.
const DefaultServiceURL = "https://entire.io"
DefaultServiceURL is the production search service URL.
const MaxLimit = 200
MaxLimit is the maximum number of results the search API will return per request.
const WildcardQuery = "*"
WildcardQuery is the query string used when only filters are provided (no search terms).
Variables ¶
This section is empty.
Functions ¶
func ParseGitHubRemote ¶
ParseGitHubRemote extracts owner and repo from a GitHub remote URL. Supports SCP-style SSH (git@github.com:owner/repo.git), ssh:// URLs (ssh://git@github.com/owner/repo.git), and HTTPS (https://github.com/owner/repo.git).
func ValidateRepoFilters ¶
ValidateRepoFilters ensures repo filters match backend semantics.
Types ¶
type CheckpointResult ¶
type CheckpointResult struct {
ID string `json:"id"`
Prompt string `json:"prompt"`
CommitMessage *string `json:"commitMessage"`
CommitSHA *string `json:"commitSha"`
Branch string `json:"branch"`
Org string `json:"org"`
Repo string `json:"repo"`
Author string `json:"author"`
AuthorUsername *string `json:"authorUsername"`
CreatedAt string `json:"createdAt"`
FilesTouched []string `json:"filesTouched"`
}
CheckpointResult represents a checkpoint returned by the search service.
type Config ¶
type Config struct {
ServiceURL string // Base URL of the search service
GitHubToken string
Owner string
Repo string
Repos []string
Query string
Limit int
Author string // Filter by author name
Date string // Filter by time period: "week" or "month"
Branch string // Filter by branch name
Page int // 1-based page number (0 means omit, API defaults to 1)
}
Config holds the configuration for a search request.
func (Config) HasFilters ¶
HasFilters reports whether any filter fields are set on the config.
type Meta ¶
type Meta struct {
MatchType string `json:"matchType"`
Score float64 `json:"score"`
Snippet string `json:"snippet,omitempty"`
}
Meta contains search ranking metadata for a result.
type ParsedInput ¶
ParsedInput holds the parsed query and optional filters extracted from search input.
func ParseSearchInput ¶
func ParseSearchInput(raw string) ParsedInput
ParseSearchInput extracts filter prefixes from raw input. Supports quoted values for single-value filters, for example: author:"alice smith". Remaining tokens become the query.
type Response ¶
type Response struct {
Results []Result `json:"results"`
Total int `json:"total"`
Page int `json:"page"`
Error string `json:"error,omitempty"`
}
Response is the search service response.
type Result ¶
type Result struct {
Type string `json:"type"`
Data CheckpointResult `json:"data"`
Meta Meta `json:"searchMeta"`
}
Result wraps a search result with its type and ranking metadata.