Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidQuery = errors.New("invalid query")
Functions ¶
This section is empty.
Types ¶
type BackendRequest ¶
type GitHubBackend ¶
type GitHubBackend struct {
// contains filtered or unexported fields
}
func NewGitHubBackend ¶
func NewGitHubBackend(client GitHubSearchClient, chunk int) *GitHubBackend
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 QueryError ¶ added in v0.12.0
type QueryError struct {
Reason string
// Query is the caller's query; it is used only to phrase hints.
Query string
}
QueryError is a query that GraphNest or the search backend refused, with a reason that is safe to show the caller.
func NewQueryError ¶ added in v0.12.0
func NewQueryError(reason string) *QueryError
NewQueryError drops control characters from reason and bounds it, so a backend message echoing a hostile query stays printable and short.
func (*QueryError) Error ¶ added in v0.12.0
func (err *QueryError) Error() string
func (*QueryError) Message ¶ added in v0.12.0
func (err *QueryError) Message() string
Message is the caller-facing text, with a hint when the reason matches a known query-syntax gotcha.
func (*QueryError) Unwrap ¶ added in v0.12.0
func (err *QueryError) Unwrap() error
type RepositoryScope ¶
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