web

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 39 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 web supplies Node-owned public web reads and configured search.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublicHTTPSClient added in v0.2.4

func NewPublicHTTPSClient(timeout time.Duration, maxRedirects int) *http.Client

NewPublicHTTPSClient fetches automatic public resources under the policy of model web reads, through the system proxy when one applies.

func SearchNative

func SearchNative(ctx context.Context, search NativeSearch) (protocol.SearchPage, error)

Types

type Auth

type Auth struct {
	Key   *protocol.Secret
	Basic *protocol.Secret
}

type FetchOptions

type FetchOptions struct {
	Resolve        func(context.Context, string) ([]netip.Addr, error)
	LocalAddresses func() ([]netip.Addr, error)
	Proxy          func(*http.Request) (*url.URL, error)
	DialContext    func(context.Context, string, string) (net.Conn, error)
	Transport      http.RoundTripper
	Now            func() time.Time
}

type Fetcher

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

func NewFetcher

func NewFetcher(options FetchOptions) *Fetcher

func (*Fetcher) Close

func (fetcher *Fetcher) Close() error

func (*Fetcher) Fetch

func (fetcher *Fetcher) Fetch(ctx context.Context, input protocol.WebRequest) (protocol.WebPage, error)

func (*Fetcher) FetchWith

func (fetcher *Fetcher) FetchWith(ctx context.Context, input protocol.WebRequest, renderer *Renderer) (protocol.WebPage, error)

type NativeSearch

type NativeSearch struct {
	Provider  protocol.ConversationProvider
	Model     string
	Input     protocol.SearchRequest
	Session   protocol.SessionID
	Request   protocol.RequestID
	Prepare   func(context.Context, map[string]any) (*http.Request, error)
	Record    func(context.Context, canonical.Usage) error
	Transport http.RoundTripper
	Secrets   []protocol.Secret
	Fetch     func(context.Context, protocol.WebRequest) (protocol.WebPage, error)
	Now       func() time.Time
}

NativeSearch uses one frozen provider binding. Prepare owns authorization and declared model policies; Record owns the caller turn's canonical usage append.

type Renderer

type Renderer struct {
	Endpoint  string
	Key       protocol.Secret
	Transport http.RoundTripper
}

type SearchOptions

type SearchOptions struct {
	Now       func() time.Time
	Transport http.RoundTripper
	Endpoints map[protocol.SearchDriver]string
	Model     func(context.Context, SearchPlan, protocol.SearchRequest) (protocol.SearchPage, error)
}

type SearchPlan

type SearchPlan struct {
	Settings    protocol.SearchSettings
	Credentials map[protocol.SearchDriver]Auth
	Model       func(context.Context, protocol.SearchRequest) (protocol.SearchPage, error)
}

type Searcher

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

func NewSearcher

func NewSearcher(options SearchOptions) *Searcher

func (*Searcher) Configure

func (searcher *Searcher) Configure(settings protocol.SearchSettings)

func (*Searcher) Search

func (searcher *Searcher) Search(ctx context.Context, plan SearchPlan, input protocol.SearchRequest) (protocol.SearchPage, error)

func (*Searcher) SearchFresh

func (searcher *Searcher) SearchFresh(ctx context.Context, plan SearchPlan, input protocol.SearchRequest, fresh bool) (protocol.SearchPage, error)

Jump to

Keyboard shortcuts

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