Skip to main content

Crate pharos_server

Crate pharos_server 

Source
Expand description

Plugin Chain contract. A Plugin returns an Outcome rather than writing to a Listener; earlier Plugins may inspect and modify the caller-owned Response buffer after awaiting Next. The Listener handles unanswered codes and errors.

Modules§

http
Small HTTP/1 listener for operational endpoints.
logging
Process-wide stdout logging, configured by the binary at startup.
metrics
The custom encoder matches Go floats, which prometheus 0.14 does not.

Structs§

Context
Borrowed Query state and reusable, preallocated Response buffer.
Lifecycle
Setup-time registration of ordered synchronous or asynchronous hooks.
Listener
A DNS Listener serving UDP and TCP on the same address.
ListenerKey
ListenerRegistry
Metadata
Caller-provided, fixed-capacity Metadata slots.
Router
Server Blocks grouped by their Listener and ordered by Domain specificity.
SelfLookupHandle
Owned Listener state for a detached Query, including its Self Lookup depth.
Server
One Listener’s routing, admission and Plugin Chain execution.
ServerBlock
A Domain’s Plugin Chain and its ordered View filters.
Stream
A placeholder for a future Zone Transfer stream.

Enums§

Action
Admission
Query admission result. Respond writes to the supplied Response buffer.
Error
Errors for the Listener to log and answer with SERVFAIL.
Outcome
Explicit result of running a Plugin Chain.
Phase
Hook phases in the configuration lifecycle.
Protocol
Protocol used by a Query.
Transport
Transport named by a Server Block Key.

Traits§

Chain
Statically dispatched Plugin Chain supplied by the Plugin registry.
Handler
Async, statically dispatched Query handling. Clear and reuse the supplied Response buffer; return Drop to suppress a Response. Handlers must not block the runtime; TCP Queries on a connection may run concurrently.
MetadataSource
A shared source whose values remain valid for a Query.
Next
A statically dispatched continuation of the Plugin Chain.
Plugin
A Plugin may await Next and inspect or modify its outcome and Response.
Readiness
A Plugin’s readiness, evaluated outside the Query hot path.

Functions§

admit
Apply the DNS Listener’s header, class, and EDNS admission policy.
contain_panic
Catch a Plugin Chain panic while polling, unless debug mode is enabled.
finish_outcome
Finish a Plugin outcome, reporting Plugin and malformed Response errors.
panics_total
Number of contained Plugin panics; metrics export is provided separately.
response_limit
Maximum Response size requested by the client for this protocol.
startup_domains
Render sorted served-Domain lines in CoreDNS’s startup format.

Type Aliases§

ViewFilter
A View filter receives the Query and client information without allocating.