docs

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package docs provides a Context7 HTTP API client for library documentation.

Plane: shared

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Context7 API client.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a Context7 client. The API key may be empty for anonymous access.

func NewClientWithBaseURL

func NewClientWithBaseURL(apiKey, baseURL string) *Client

NewClientWithBaseURL creates a Context7 client with a custom base URL (for tests).

func (*Client) Docs

func (c *Client) Docs(ctx context.Context, libraryID, topic string, tokens int) (string, error)

Docs fetches documentation for a Context7 library ID.

func (*Client) Resolve

func (c *Client) Resolve(ctx context.Context, query string) ([]Library, error)

Resolve searches Context7 for libraries matching the query.

type Library

type Library struct {
	ID            string   `json:"id"`
	Title         string   `json:"title"`
	Description   string   `json:"description"`
	TrustScore    float64  `json:"trust_score"`
	TotalSnippets int      `json:"total_snippets"`
	Versions      []string `json:"versions,omitempty"`
}

Library represents a Context7 library result.

Jump to

Keyboard shortcuts

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