adapter

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: GPL-3.0 Imports: 3 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

Index

Constants

This section is empty.

Variables

View Source
var Registry = map[string]Adapter{}

Registry maps source type strings to their adapter implementations.

Functions

func Register

func Register(sourceType string, a Adapter)

Register adds an adapter to the registry. Called from adapter package init() functions.

Types

type Adapter

type Adapter interface {
	// Crawl fetches all pages from the source and sends them to the returned channel.
	// The channel is closed when crawling is complete or ctx is cancelled.
	// The first return value is the total number of URLs to be crawled (0 if unknown).
	Crawl(ctx context.Context, source config.SourceConfig, sourceID int64) (int, <-chan db.Page, error)
	// NeedsAuth returns true if the source requires authentication before crawling.
	NeedsAuth(source config.SourceConfig) bool
}

Adapter is implemented by each documentation source type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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