Versions in this module Expand all Collapse all v0 v0.1.0 Aug 30, 2026 Changes in this version + const DefaultMaxInFlight + const DefaultMaxTCPConns + const DefaultQueryTimeout + const DefaultReadTimeout + const DefaultWriteTimeout + const MaxUDPResponse + var ErrClosed = errors.New("server: closed") + var ErrNoHandler = errors.New("server: no handler configured") + type Options struct + Clock clock.Clock + Events *events.Bus + Handler resolver.Handler + Logger *slog.Logger + MaxInFlight int + MaxTCPConns int + MaxUDPResponse int + Metrics metrics.Recorder + QueryTimeout time.Duration + ReadTimeout time.Duration + WriteTimeout time.Duration + func (o Options) Validate() error + type Server struct + func New(opts Options) (*Server, error) + func (s *Server) ListenAndServe(network, addr string) error + func (s *Server) Serve(pc net.PacketConn, l net.Listener) error + func (s *Server) Shutdown(ctx context.Context) error + func (s *Server) Stats() Stats + type Stats struct + Answered uint64 + Dropped uint64 + Malformed uint64 + Panics uint64 + Queries uint64 + RefusedLoop uint64 + TCPConns uint64 + TCPOpen int64 + TCPRefused uint64 + Truncated uint64 + WriteErrors uint64