search

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 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

This section is empty.

Variables

View Source
var ErrInvalidQuery = errors.New("invalid query")

Functions

This section is empty.

Types

type BackendRequest

type BackendRequest struct {
	Query            string
	RepositoryIDs    []uint32
	RepositoryScopes []RepositoryScope
	InstallationID   int64
	Limit            int
	ContextLines     int
	Timeout          time.Duration
}

type GitHubBackend

type GitHubBackend struct {
	// contains filtered or unexported fields
}

func NewGitHubBackend

func NewGitHubBackend(client GitHubSearchClient, chunk int) *GitHubBackend

func (*GitHubBackend) Health

func (backend *GitHubBackend) Health(context.Context) error

func (*GitHubBackend) Search

func (backend *GitHubBackend) Search(ctx context.Context, request BackendRequest) (api.SearchResponse, error)

type GitHubSearchClient

type GitHubSearchClient interface {
	SearchCode(context.Context, int64, string, []int64) (api.SearchResponse, error)
}

GitHubSearchClient is deliberately limited to installation-scoped search.

type Limits

type Limits struct {
	DefaultResults, MaxResults           int
	DefaultContextLines, MaxContextLines int
	DefaultTimeout, MaxTimeout           time.Duration
	MaxResponseBytes                     int64
}

type RepositoryScope

type RepositoryScope struct {
	ID, GitHubID, InstallationID int64
	Name                         string
	IndexedSHA                   string
}

RepositoryScope is the backend-neutral, authorization-derived repository identity. Backends must never discover repositories independently.

type SearchBackend

type SearchBackend interface {
	Search(context.Context, BackendRequest) (api.SearchResponse, error)
	Health(context.Context) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(backend SearchBackend, authorizer authz.Authorizer, limits Limits) *Service

func (*Service) Search

func (service *Service) Search(ctx context.Context, principal authn.Principal, request api.SearchRequest) (api.SearchResponse, error)

Jump to

Keyboard shortcuts

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