api

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SCIPStatusCurrent = "current"
	SCIPStatusStale   = "stale"
	SCIPStatusAbsent  = "absent"
	SCIPStatusUnknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyRefreshResponse

type DependencyRefreshResponse struct {
	Available bool `json:"available"`
	Packages  int  `json:"packages"`
}

type GraphBoundary

type GraphBoundary struct {
	RepositoryID int64  `json:"repository_id,omitempty"`
	Repository   string `json:"repository,omitempty"`
	Reason       string `json:"reason"`
	Depth        int    `json:"depth,omitempty"`
}

type GraphCandidate

type GraphCandidate struct {
	UID          string  `json:"uid"`
	Name         string  `json:"name"`
	Kind         string  `json:"kind"`
	FilePath     string  `json:"file_path"`
	RepositoryID int64   `json:"repository_id"`
	Line         int     `json:"line"`
	Score        float64 `json:"score"`
}

type GraphContextRequest

type GraphContextRequest struct {
	Repo GraphRepositorySelector `json:"repo,omitzero"`
	GraphSymbolSelector
	Branch            string   `json:"branch,omitempty"`
	Relations         []string `json:"relations,omitempty"`
	PerCategoryLimit  int      `json:"per_category_limit,omitempty"`
	PerCategoryOffset int      `json:"per_category_offset,omitempty"`
	IncludeContent    bool     `json:"include_content,omitempty"`
}

type GraphContextResponse

type GraphContextResponse struct {
	Status     string                      `json:"status"`
	Symbol     *GraphSymbol                `json:"symbol,omitempty"`
	Candidates []GraphCandidate            `json:"candidates,omitempty"`
	Incoming   map[string][]GraphReference `json:"incoming,omitempty"`
	Outgoing   map[string][]GraphReference `json:"outgoing,omitempty"`
	Boundaries []GraphBoundary             `json:"boundaries,omitempty"`
	Commits    map[string]string           `json:"commits"`
}

type GraphImpactRequest

type GraphImpactRequest struct {
	Repo          GraphRepositorySelector `json:"repo,omitzero"`
	Branch        string                  `json:"branch,omitempty"`
	TargetUID     string                  `json:"target_uid"`
	Direction     string                  `json:"direction"`
	Relations     []string                `json:"relations,omitempty"`
	MinConfidence float64                 `json:"min_confidence,omitempty"`
	IncludeTests  bool                    `json:"include_tests,omitempty"`
	MaxDepth      int                     `json:"max_depth,omitempty"`
	Limit         int                     `json:"limit,omitempty"`
	Offset        int                     `json:"offset,omitempty"`
	SummaryOnly   bool                    `json:"summary_only,omitempty"`
}

type GraphImpactResponse

type GraphImpactResponse struct {
	Status     string                `json:"status"`
	Candidates []GraphCandidate      `json:"candidates,omitempty"`
	ByDepth    map[int][]GraphSymbol `json:"by_depth"`
	Relations  []GraphReference      `json:"relations,omitempty"`
	Boundaries []GraphBoundary       `json:"boundaries,omitempty"`
	Commits    map[string]string     `json:"commits"`
	Partial    bool                  `json:"partial"`
}

type GraphJobState

type GraphJobState string
const (
	GraphJobStateQueued     GraphJobState = "queued"
	GraphJobStateRunning    GraphJobState = "running"
	GraphJobStateSucceeded  GraphJobState = "succeeded"
	GraphJobStateFailed     GraphJobState = "failed"
	GraphJobStateSuperseded GraphJobState = "superseded"
)

type GraphPosition

type GraphPosition struct {
	StartLine      int `json:"start_line"`
	StartCharacter int `json:"start_character"`
	EndLine        int `json:"end_line"`
	EndCharacter   int `json:"end_character"`
}

type GraphReference

type GraphReference struct {
	SourceRepositoryID int64         `json:"source_repository_id"`
	TargetRepositoryID int64         `json:"target_repository_id"`
	SourceUID          string        `json:"source_uid"`
	TargetUID          string        `json:"target_uid"`
	Kind               string        `json:"kind"`
	Path               string        `json:"path,omitempty"`
	Range              GraphPosition `json:"range"`
	Confidence         float64       `json:"confidence"`
	ResolutionReason   string        `json:"resolution_reason,omitempty"`
}

type GraphRepositorySelector

type GraphRepositorySelector struct {
	ID   int64
	Name string
}

func (GraphRepositorySelector) IsZero

func (selector GraphRepositorySelector) IsZero() bool

func (GraphRepositorySelector) MarshalJSON

func (selector GraphRepositorySelector) MarshalJSON() ([]byte, error)

func (*GraphRepositorySelector) UnmarshalJSON

func (selector *GraphRepositorySelector) UnmarshalJSON(data []byte) error

type GraphSource

type GraphSource string
const (
	GraphSourceManaged  GraphSource = "managed"
	GraphSourceExternal GraphSource = "external"
)

type GraphState

type GraphState string
const (
	GraphStateNotIndexed GraphState = "not_indexed"
	GraphStatePending    GraphState = "pending"
	GraphStateFallback   GraphState = "fallback"
	GraphStateDegraded   GraphState = "degraded"
	GraphStateReady      GraphState = "ready"
)

type GraphStatus

type GraphStatus struct {
	RepositoryID int64               `json:"repository_id"`
	Commit       string              `json:"commit,omitempty"`
	State        GraphState          `json:"state"`
	Source       GraphSource         `json:"source,omitempty"`
	JobState     GraphJobState       `json:"job_state,omitempty"`
	ErrorCode    string              `json:"error_code,omitempty"`
	SCIPFallback *SCIPFallbackStatus `json:"scip_fallback,omitempty"`
}

type GraphSymbol

type GraphSymbol struct {
	UID          string        `json:"uid"`
	Name         string        `json:"name"`
	Kind         string        `json:"kind"`
	FilePath     string        `json:"file_path"`
	Language     string        `json:"language"`
	Signature    string        `json:"signature,omitempty"`
	RepositoryID int64         `json:"repository_id"`
	Range        GraphPosition `json:"range"`
	Test         bool          `json:"test"`
	Content      string        `json:"content,omitempty"`
}

type GraphSymbolSelector

type GraphSymbolSelector struct {
	UID      string `json:"uid,omitempty"`
	Name     string `json:"name,omitempty"`
	FilePath string `json:"file_path,omitempty"`
	Kind     string `json:"kind,omitempty"`
}

type GraphTraceRequest

type GraphTraceRequest struct {
	Repo      GraphRepositorySelector `json:"repo,omitzero"`
	Branch    string                  `json:"branch,omitempty"`
	SourceUID string                  `json:"source_uid"`
	TargetUID string                  `json:"target_uid"`
	MaxDepth  int                     `json:"max_depth,omitempty"`
}

type GraphTraceResponse

type GraphTraceResponse struct {
	Status     string            `json:"status"`
	Candidates []GraphCandidate  `json:"candidates,omitempty"`
	Nodes      []GraphSymbol     `json:"nodes,omitempty"`
	Relations  []GraphReference  `json:"relations,omitempty"`
	Boundaries []GraphBoundary   `json:"boundaries,omitempty"`
	Commits    map[string]string `json:"commits"`
}

type ReadFileRequest

type ReadFileRequest struct {
	RepositoryID int64  `json:"repository_id"`
	Path         string `json:"path"`
	StartLine    int    `json:"start_line,omitempty"`
	EndLine      int    `json:"end_line,omitempty"`
}

type ReadFileResponse

type ReadFileResponse struct {
	RepositoryID int64  `json:"repository_id"`
	Path         string `json:"path"`
	IndexedSHA   string `json:"indexed_sha"`
	BlobSHA      string `json:"blob_sha"`
	Content      string `json:"content"`
	StartLine    int    `json:"start_line"`
	EndLine      int    `json:"end_line"`
	Truncated    bool   `json:"truncated"`
}

type Repository

type Repository struct {
	ID         int64  `json:"id"`
	Name       string `json:"name"`
	Branch     string `json:"branch"`
	IndexedSHA string `json:"indexed_sha"`
	WebURL     string `json:"web_url"`
}

type RepositoryPackages

type RepositoryPackages struct {
	Provides  []string `json:"provides"`
	DependsOn []string `json:"depends_on"`
}

type RepositorySummary

type RepositorySummary struct {
	ID            int64      `json:"id"`
	GitHubID      int64      `json:"github_id"`
	Name          string     `json:"name"`
	Branch        string     `json:"branch"`
	DesiredSHA    string     `json:"desired_sha"`
	IndexedSHA    string     `json:"indexed_sha"`
	WebURL        string     `json:"web_url"`
	Status        string     `json:"status"`
	ErrorCode     string     `json:"error_code"`
	SearchNode    string     `json:"search_node"`
	LastIndexedAt *time.Time `json:"last_indexed_at,omitempty"`
	// SCIPStatus reports whether code navigation is usable: "current", "stale",
	// "absent", or "unknown". Search being healthy says nothing about SCIP, so
	// callers need this to tell why navigation tools fail on an indexed repository.
	SCIPStatus string `json:"scip_status"`
	SCIPCommit string `json:"scip_commit,omitempty"`
}

type SCIPFallbackStatus

type SCIPFallbackStatus struct {
	Commit string `json:"commit"`
}

type SCIPLocation

type SCIPLocation struct {
	RepositoryID     int64  `json:"repository_id"`
	RepositoryName   string `json:"repository_name"`
	Branch           string `json:"branch"`
	WebURL           string `json:"web_url"`
	Commit           string `json:"commit"`
	Path             string `json:"path"`
	Symbol           string `json:"symbol"`
	StartLine        int    `json:"start_line"`
	StartCharacter   int    `json:"start_character"`
	EndLine          int    `json:"end_line"`
	EndCharacter     int    `json:"end_character"`
	PositionEncoding string `json:"position_encoding"`
	Roles            int32  `json:"roles"`
	Approximate      bool   `json:"approximate"`
}

type SCIPNavigationRequest

type SCIPNavigationRequest struct {
	RepositoryID   int64  `json:"repository_id"`
	Path           string `json:"path"`
	Commit         string `json:"commit,omitempty"`
	Line           int    `json:"line"`
	Character      int    `json:"character"`
	CharacterUTF8  *int   `json:"character_utf8,omitempty"`
	CharacterUTF16 *int   `json:"character_utf16,omitempty"`
	CharacterUTF32 *int   `json:"character_utf32,omitempty"`
	Operation      string `json:"operation"`
}

type SCIPNavigationResponse

type SCIPNavigationResponse struct {
	Locations []SCIPLocation `json:"locations"`
	Truncated bool           `json:"truncated"`
}

type SearchConsistency

type SearchConsistency struct {
	Backend  string `json:"backend"`
	Exact    bool   `json:"exact"`
	Revision string `json:"revision,omitempty"`
	Partial  bool   `json:"partial"`
}

SearchConsistency states what the selected backend can prove about results.

type SearchMatch

type SearchMatch struct {
	Repository Repository `json:"repository"`
	Path       string     `json:"path"`
	SHA        string     `json:"sha"`
	LineNumber int        `json:"line_number"`
	LineStart  int        `json:"line_start"`
	LineEnd    int        `json:"line_end"`
	Preview    string     `json:"preview"`
	Score      float64    `json:"score"`
	ZoektID    uint32     `json:"-"`
	Branches   []string   `json:"-"`
}

type SearchRequest

type SearchRequest struct {
	Query            string        `json:"query"`
	Repositories     []string      `json:"repositories,omitempty"`
	Limit            int           `json:"limit,omitempty"`
	ContextLines     int           `json:"context_lines,omitempty"`
	Timeout          time.Duration `json:"timeout,omitempty"`
	MaxResponseBytes int64         `json:"max_response_bytes,omitempty"`
}

type SearchResponse

type SearchResponse struct {
	Matches     []SearchMatch      `json:"matches"`
	Truncated   bool               `json:"truncated"`
	Consistency *SearchConsistency `json:"consistency,omitempty"`
}

Jump to

Keyboard shortcuts

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