Documentation
¶
Index ¶
Constants ¶
const ( OutcomeOK = "ok" OutcomeRequestFailed = "request_failed" OutcomeResponseTooLarge = "response_too_large" OutcomeUnsupportedContent = "unsupported_content" OutcomeExtractionFailed = "extraction_failed" )
Variables ¶
This section is empty.
Functions ¶
func AdmissibleHTTPS ¶
AdmissibleHTTPS reports whether raw names an HTTPS target FetchText would admit, returning its canonical credential-redacted form. A caller that surfaces a URL before any fetch runs it through here so it cannot offer a target the fetch path would later refuse. The result is never length-bounded: a cut through a percent escape names a different target or no valid URL at all, so a caller with a field limit must drop an over-long candidate rather than truncate it.
Types ¶
type Authorizer ¶
Authorizer decides one Target before its request is built. Any non-nil error, whether a denial or an undecidable request, means nothing is sent.
type FetchResult ¶
type FetchResult struct {
FinalURL string `json:"final_url,omitempty"`
Content string `json:"content,omitempty"`
Outcome string `json:"outcome"`
}
func FetchText ¶
func FetchText(ctx context.Context, client *http.Client, rawURL string, authorize Authorizer, outputCap int) FetchResult
type SearchBackend ¶
SearchBackend runs one query against a search provider. The returned candidates keep the provider's relevance order, and no provider or transport type crosses this boundary.