mirror of
https://github.com/miekg/dns.git
synced 2025-12-16 09:11:34 +01:00
add authors.bind and friends.
This commit is contained in:
parent
88902fc943
commit
ac51a3e97d
12
server.go
12
server.go
@ -70,6 +70,9 @@ func NewServeMux() *ServeMux { return &ServeMux{m: radix.New()} }
|
|||||||
// DefaultServeMux is the default ServeMux used by Serve.
|
// DefaultServeMux is the default ServeMux used by Serve.
|
||||||
var DefaultServeMux = NewServeMux()
|
var DefaultServeMux = NewServeMux()
|
||||||
|
|
||||||
|
// Authors is a list of authors that helped create or make Go DNS better.
|
||||||
|
var Authors = []string{ "Miek Gieben", "Ask Bjorn Hansen", "Dave Cheney", "Dusty Wilson", "Peter van Dijk"}
|
||||||
|
|
||||||
// The HandlerFunc type is an adapter to allow the use of
|
// The HandlerFunc type is an adapter to allow the use of
|
||||||
// ordinary functions as DNS handlers. If f is a function
|
// ordinary functions as DNS handlers. If f is a function
|
||||||
// with the appropriate signature, HandlerFunc(f) is a
|
// with the appropriate signature, HandlerFunc(f) is a
|
||||||
@ -109,17 +112,10 @@ func HandleAuthors(w ResponseWriter, r *Msg) {
|
|||||||
// primary author
|
// primary author
|
||||||
m := new(Msg)
|
m := new(Msg)
|
||||||
m.SetReply(r)
|
m.SetReply(r)
|
||||||
for _, author := range []string{"Miek Gieben"} {
|
for _, author := range Authors {
|
||||||
h := RR_Header{r.Question[0].Name, TypeTXT, ClassCHAOS, 0, 0}
|
h := RR_Header{r.Question[0].Name, TypeTXT, ClassCHAOS, 0, 0}
|
||||||
m.Answer = append(m.Answer, &RR_TXT{h, []string{author}})
|
m.Answer = append(m.Answer, &RR_TXT{h, []string{author}})
|
||||||
}
|
}
|
||||||
// from git:
|
|
||||||
// git log |grep '^Author' | sort -u | sed 's/^Author: //' | sed 's/<.*>//'
|
|
||||||
// But only if I have a firstname and lastname
|
|
||||||
for _, author := range []string{"Ask Bjorn Hansen", "Dave Cheney", "Dusty Wilson", "Peter van Dijk"} {
|
|
||||||
h := RR_Header{r.Question[0].Name, TypeTXT, ClassCHAOS, 0, 0}
|
|
||||||
m.Extra = append(m.Extra, &RR_TXT{h, []string{author}})
|
|
||||||
}
|
|
||||||
w.Write(m)
|
w.Write(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user