{"modulePath":"github.com/volcengine/volcengine-cli","version":"v1.2.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package docs\n\nPackage docs implements unsigned access to the public Volcengine documentation search service.\n\n## Constants\n\n```go\nconst (\n\tDefaultSearchLimit   = 10\n\tDefaultSnippetLength = 600\n\tDefaultFetchLength   = 5000\n)\n```\n\n## Types\n\n```go\ntype FetchOptions struct {\n\tURL        string\n\tStartIndex int\n\tMaxLength  int\n}\n```\nFetchOptions controls local pagination after a document has been fetched.\n\n```go\ntype FetchResult struct {\n\tRequestID           string `json:\"request_id\"`\n\tTitle               string `json:\"title\"`\n\tURL                 string `json:\"url\"`\n\tContent             string `json:\"content\"`\n\tStartIndex          int    `json:\"start_index\"`\n\tNextStartIndex      *int   `json:\"next_start_index\"`\n\tRemainingCharacters int    `json:\"remaining_characters\"`\n\tHasMore             bool   `json:\"has_more\"`\n\tHasContent          bool   `json:\"has_content\"`\n}\n```\nFetchResult is the stable structured output of Fetch.\n\n```go\ntype Module interface {\n\tSearch(context.Context, SearchOptions) (SearchResult, error)\n\tFetch(context.Context, FetchOptions) (FetchResult, error)\n}\n```\nModule is the public documentation search interface used by the command adapter. Authentication, profiles and regions are deliberately absent.\n\n```go\nfunc New(userAgent string) Module\n```\nNew creates a production documentation module. The client uses the standard Go transport (including its proxy environment support), but never signs a request or loads CLI credentials. The local client ID is loaded lazily, only when a validated search/fetch request is about to be sent.\n\n```go\ntype SearchDocument struct {\n\tTitle        string   `json:\"title\"`\n\tURL          string   `json:\"url\"`\n\tServiceCodes []string `json:\"service_codes\"`\n\tSnippet      string   `json:\"snippet\"`\n}\n```\nSearchDocument is one normalized search result.\n\n```go\ntype SearchOptions struct {\n\tQuery         string\n\tLimit         int\n\tServiceCodes  []string\n\tSnippetLength int\n}\n```\nSearchOptions controls one documentation search.\n\n```go\ntype SearchResult struct {\n\tRequestID string           `json:\"request_id\"`\n\tDocuments []SearchDocument `json:\"documents\"`\n}\n```\nSearchResult is the stable structured output of Search.\n\n```go\ntype UpstreamError struct {\n\tCode      string\n\tMessage   string\n\tRequestID string\n}\n```\nUpstreamError reports a business error returned in an HTTP 200 response.\n\n```go\nfunc (e *UpstreamError) Error() string\n```\n\n","path":"github.com/volcengine/volcengine-cli/internal/docs","name":"docs","synopsis":"Package docs implements unsigned access to the public Volcengine documentation search service.","isRedistributable":true}
