本文整理匯總了Golang中dns.RequestWriter類的典型用法代碼示例。如果您正苦於以下問題:Golang RequestWriter類的具體用法?Golang RequestWriter怎麽用?Golang RequestWriter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了RequestWriter類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: q
func q(w dns.RequestWriter, m *dns.Msg) {
w.Send(m)
r, err := w.Receive()
if err != nil {
fmt.Printf("%s\n", err.Error())
}
w.Write(r)
}
示例2: qhandler
func qhandler(w dns.RequestWriter, m *dns.Msg) {
w.Send(m)
r, _ := w.Receive()
w.Write(r)
}
示例3: qhandler
func qhandler(w dns.RequestWriter, m *dns.Msg) {
w.Dial()
defer w.Close()
if err := w.Send(m); err != nil {
w.Write(nil)
return
}
r, _ := w.Receive()
w.Write(r)
}
示例4: q
func q(w dns.RequestWriter, m *dns.Msg) {
if err := w.Send(m); err != nil {
fmt.Printf("%s\n", err.Error())
w.Write(nil)
return
}
r, err := w.Receive()
if err != nil {
fmt.Printf("%s\n", err.Error())
w.Write(nil)
return
}
w.Close()
if w.TsigStatus() != nil {
fmt.Printf(";; Couldn't verify TSIG signature: %s\n", w.TsigStatus().Error())
}
w.Write(r)
}