Documentation
¶
Overview ¶
Package docs implements unsigned access to the public Volcengine documentation search service.
Index ¶
Constants ¶
View Source
const ( DefaultSearchLimit = 10 DefaultSnippetLength = 600 DefaultFetchLength = 5000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchOptions ¶
FetchOptions controls local pagination after a document has been fetched.
type FetchResult ¶
type FetchResult struct {
RequestID string `json:"request_id"`
Title string `json:"title"`
URL string `json:"url"`
Content string `json:"content"`
StartIndex int `json:"start_index"`
NextStartIndex *int `json:"next_start_index"`
RemainingCharacters int `json:"remaining_characters"`
HasMore bool `json:"has_more"`
HasContent bool `json:"has_content"`
}
FetchResult is the stable structured output of Fetch.
type Module ¶
type Module interface {
Search(context.Context, SearchOptions) (SearchResult, error)
Fetch(context.Context, FetchOptions) (FetchResult, error)
}
Module is the public documentation search interface used by the command adapter. Authentication, profiles and regions are deliberately absent.
type SearchDocument ¶
type SearchDocument struct {
Title string `json:"title"`
URL string `json:"url"`
ServiceCodes []string `json:"service_codes"`
Snippet string `json:"snippet"`
}
SearchDocument is one normalized search result.
type SearchOptions ¶
SearchOptions controls one documentation search.
type SearchResult ¶
type SearchResult struct {
RequestID string `json:"request_id"`
Documents []SearchDocument `json:"documents"`
}
SearchResult is the stable structured output of Search.
type UpstreamError ¶
UpstreamError reports a business error returned in an HTTP 200 response.
func (*UpstreamError) Error ¶
func (e *UpstreamError) Error() string
Click to show internal directories.
Click to hide internal directories.