docs

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 13 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

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

type FetchOptions struct {
	URL        string
	StartIndex int
	MaxLength  int
}

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.

func New

func New(userAgent string) Module

New 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.

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

type SearchOptions struct {
	Query         string
	Limit         int
	ServiceCodes  []string
	SnippetLength int
}

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

type UpstreamError struct {
	Code      string
	Message   string
	RequestID string
}

UpstreamError reports a business error returned in an HTTP 200 response.

func (*UpstreamError) Error

func (e *UpstreamError) Error() string

Jump to

Keyboard shortcuts

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