More comments

This commit is contained in:
Miek Gieben 2017-07-29 10:48:27 +01:00
parent 4932cca5e2
commit 4d14b01c84

View File

@ -17,6 +17,9 @@ type Example struct {
// ServeDNS implements the middleware.Handler interface. // ServeDNS implements the middleware.Handler interface.
func (e Example) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { func (e Example) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
// Somewhat convoluted, as we could have printed "example" here and just call
// the next middleware - but as an example, show how to wrap a ResponseWriter might be
// educational.
pw := NewResponsePrinter(w) pw := NewResponsePrinter(w)
return middleware.NextOrFailure(e.Name(), e.Next, ctx, pw, r) return middleware.NextOrFailure(e.Name(), e.Next, ctx, pw, r)
} }