Documentation
¶
Overview ¶
Package hostbridge wires a stream of domain-registration events from the overcast emulator to the host machine's mDNS responder and local trust store. It is the implementation behind the `overcast dev` subcommand.
The bridge is deliberately small: it owns an active set of published records, consumes Events from a Source, and translates them into calls on an mdns.Publisher. Everything platform-specific lives behind the mdns.Publisher and trust.Store interfaces — this file has no OS knowledge.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge consumes Events from a Source and drives an mdns.Publisher, maintaining an internal set of currently-published records so that Close cleanly withdraws every advertisement on shutdown.
func New ¶
New constructs a Bridge. All three arguments are required; passing nil for any of them is a programming error.
func (*Bridge) Active ¶
Active returns a snapshot of the currently-published records. Intended for tests and for the `overcast status` subcommand.
func (*Bridge) Run ¶
Run drives the bridge until ctx is cancelled or the Source's channel is closed. It always withdraws any records it has published before returning, even on error, so callers can simply defer-cancel their context.
Run returns nil when the source channel closes cleanly, ctx.Err() when the caller cancels, and a wrapped error if the source or publisher fails.
type EventType ¶
type EventType int
EventType distinguishes a domain registration from a de-registration.
type Source ¶
Source is the upstream feed of domain events. The overcast host CLI implementation of Source tails the emulator's /_internal/domains/watch SSE endpoint; tests can supply an in-memory channel instead.
Watch must return a channel that is closed when the underlying feed terminates (either cleanly or due to an error). Implementations should honour ctx cancellation to unblock the caller promptly.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mdns defines the Publisher contract used by the overcast host CLI to advertise custom domain names through the operating system's multicast DNS responder (Bonjour on macOS, Avahi on Linux, DNS-SD on Windows).
|
Package mdns defines the Publisher contract used by the overcast host CLI to advertise custom domain names through the operating system's multicast DNS responder (Bonjour on macOS, Avahi on Linux, DNS-SD on Windows). |
|
Package trust owns the Overcast local Certificate Authority: minting it, signing leaf server certificates from it (see ca.go), and installing the CA certificate into the operating system's trust store so browsers and HTTP clients accept Overcast's HTTPS without the usual self-signed-cert dance.
|
Package trust owns the Overcast local Certificate Authority: minting it, signing leaf server certificates from it (see ca.go), and installing the CA certificate into the operating system's trust store so browsers and HTTP clients accept Overcast's HTTPS without the usual self-signed-cert dance. |