mirror of
https://github.com/miekg/dns.git
synced 2025-08-12 04:26:58 +02:00
Create a DefaultQueryChan
This commit is contained in:
parent
39be50cc6a
commit
950e39d29b
@ -17,7 +17,6 @@ type QueryHandler interface {
|
|||||||
QueryDNS(w RequestWriter, q *Msg)
|
QueryDNS(w RequestWriter, q *Msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A RequestWriter interface is used by an DNS query handler to
|
// A RequestWriter interface is used by an DNS query handler to
|
||||||
// construct an DNS request.
|
// construct an DNS request.
|
||||||
type RequestWriter interface {
|
type RequestWriter interface {
|
||||||
@ -54,6 +53,11 @@ func NewQueryMux() *QueryMux { return &QueryMux{make(map[string]QueryHandler)} }
|
|||||||
// DefaultQueryMux is the default QueryMux used by Query.
|
// DefaultQueryMux is the default QueryMux used by Query.
|
||||||
var DefaultQueryMux = NewQueryMux()
|
var DefaultQueryMux = NewQueryMux()
|
||||||
|
|
||||||
|
func newQueryChan() chan *Msg { return make(chan *Msg) }
|
||||||
|
|
||||||
|
// Default channel to use for the resolver
|
||||||
|
var DefaultQueryChan = newQueryChan()
|
||||||
|
|
||||||
// The HandlerQueryFunc type is an adapter to allow the use of
|
// The HandlerQueryFunc type is an adapter to allow the use of
|
||||||
// ordinary functions as DNS query handlers. If f is a function
|
// ordinary functions as DNS query handlers. If f is a function
|
||||||
// with the appropriate signature, HandlerQueryFunc(f) is a
|
// with the appropriate signature, HandlerQueryFunc(f) is a
|
||||||
|
Loading…
Reference in New Issue
Block a user