Versions in this module Expand all Collapse all v1 v1.4.0 Oct 20, 2026 Changes in this version + func LiveHTTPClient() *http.Client + func SelfSignedTLSListener(handler http.Handler) (listener net.Listener, client *http.Client, endpoint string, err error) + type Backend interface + Fetch func(ctx context.Context, target string) (*FetchResult, error) + Search func(ctx context.Context, query string, limit int) ([]SearchHit, error) + type BingSearch struct + APIKey string + Client *http.Client + Endpoint string + func (b *BingSearch) Search(ctx context.Context, query string, limit int) ([]SearchHit, error) + type BraveSearch struct + APIKey string + Client *http.Client + Endpoint string + func (b *BraveSearch) Search(ctx context.Context, query string, limit int) ([]SearchHit, error) + type CompositeBackend struct + FetchProvider FetchProvider + SearchProvider SearchProvider + func (c *CompositeBackend) Fetch(ctx context.Context, target string) (*FetchResult, error) + func (c *CompositeBackend) Search(ctx context.Context, query string, limit int) ([]SearchHit, error) + type Document struct + Content string + PublishedAt string + SourceID string + Tags []string + Title string + URL string + func Corpus() []Document + type DoubaoSearch struct + APIKey string + Client *http.Client + Endpoint string + func (d *DoubaoSearch) Search(ctx context.Context, query string, limit int) ([]SearchHit, error) + type FetchProvider interface + Fetch func(context.Context, string) (*FetchResult, error) + type FetchResult struct + Content string + FetchedAt string + SourceID string + Title string + URL string + type LiveFetch struct + Client *http.Client + func (l *LiveFetch) Fetch(ctx context.Context, target string) (*FetchResult, error) + type SearchHit struct + PublishedAt string + Snippet string + SourceID string + Title string + URL string + type SearchProvider interface + Search func(context.Context, string, int) ([]SearchHit, error) + type Server struct + func New(documents []Document) *Server + func (s *Server) CountFetches(observer func(action string)) + func (s *Server) InjectFetchFailures(token string, count int) + func (s *Server) ServeHTTP(writer http.ResponseWriter, request *http.Request) + func (s *Server) WithBackend(backend Backend) *Server