server: split HTTP scaffolding into its own subpackage
Move server.go and interactive.go (and their tests) from the root checker/ package into checker/server/. Plugin and builtin consumers of the SDK now import only checker/ and no longer drag net/http, html/template, or the form-rendering code into their artifacts: on checker-dane.so this drops the binary by ~1.2 MB and removes 170 html/template symbols along with the net/http contribution that came from the SDK itself. Breaking for standalone consumers (main.go): NewServer(p) -> server.New(p) CheckerInteractive -> server.Interactive InteractiveRelatedProviders -> server.Siblings Providers that only satisfy the interactive interfaces structurally (method set match, no explicit type reference) need no source change; only main.go has to switch its import path and the constructor name.
This commit is contained in:
parent
c244ca48c6
commit
89cc3f112b
6 changed files with 276 additions and 240 deletions
|
|
@ -372,21 +372,6 @@ type CheckerDefinitionProvider interface {
|
|||
Definition() *CheckerDefinition
|
||||
}
|
||||
|
||||
// InteractiveRelatedProviders is an optional interface an interactive
|
||||
// ObservationProvider can co-implement to declare sibling providers whose
|
||||
// Collect the SDK runs in-process during /check. Their results are
|
||||
// exposed as RelatedObservations on ObservationGetter and ReportContext,
|
||||
// mirroring the cross-checker lineage a happyDomain host resolves.
|
||||
//
|
||||
// For each sibling the SDK seeds options from the primary and, when the
|
||||
// primary implements DiscoveryPublisher, writes its entries into any
|
||||
// sibling option tagged AutoFill == AutoFillDiscoveryEntries. Sibling
|
||||
// errors are logged and skipped so the primary result still reaches the
|
||||
// user.
|
||||
type InteractiveRelatedProviders interface {
|
||||
RelatedProviders() []ObservationProvider
|
||||
}
|
||||
|
||||
// CheckerDefinition is the complete definition of a checker, registered via init().
|
||||
type CheckerDefinition struct {
|
||||
ID string `json:"id"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue