Documentation
¶
Overview ¶
Package api hosts the HTTP routing layer: a chi router that exposes /api/v1/scan (POST + GET by id) and /api/v1/checks, wired with request-ID, slog request logger, panic recovery and per-IP rate limiting. All inbound JSON shapes and error codes follow
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Scanner ScanService
Config *config.Config
Logger *slog.Logger
}
Deps groups the runtime dependencies used to build a router.
type ScanService ¶
type ScanService interface {
Run(ctx context.Context, req scanner.Request) (*scan.Result, error)
Get(id string) (*scan.Result, bool)
History(limit int) []history.Entry
}
ScanService is the subset of scanner.Scanner the API depends on. scanner.Scanner satisfies this interface; tests inject a fake to bypass the real DNS + probe pipeline.
Click to show internal directories.
Click to hide internal directories.