Small documenation updates
This commit is contained in:
parent
84dfdab584
commit
45ac2dd0c0
4 changed files with 7 additions and 5 deletions
|
@ -11,7 +11,7 @@ import (
|
||||||
// The function orders names in DNSSEC canonical order: RFC 4034s section-6.1
|
// The function orders names in DNSSEC canonical order: RFC 4034s section-6.1
|
||||||
//
|
//
|
||||||
// See http://bert-hubert.blogspot.co.uk/2015/10/how-to-do-fast-canonical-ordering-of.html
|
// See http://bert-hubert.blogspot.co.uk/2015/10/how-to-do-fast-canonical-ordering-of.html
|
||||||
// for a blog article on this implementation:
|
// for a blog article on this implementation.
|
||||||
func Less(a, b string) int {
|
func Less(a, b string) int {
|
||||||
i := 1
|
i := 1
|
||||||
aj := len(a)
|
aj := len(a)
|
||||||
|
|
|
@ -9,10 +9,12 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Chaos allows CoreDNS to reply to CH TXT queries and return author or
|
||||||
|
// version information.
|
||||||
type Chaos struct {
|
type Chaos struct {
|
||||||
Next middleware.Handler
|
Next middleware.Handler
|
||||||
Version string
|
Version string
|
||||||
Authors map[string]bool // get randomization for free \o/
|
Authors map[string]bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Chaos) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
func (c Chaos) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
|
|
||||||
// Replacer is a type which can replace placeholder
|
// Replacer is a type which can replace placeholder
|
||||||
// substrings in a string with actual values from a
|
// substrings in a string with actual values from a
|
||||||
// http.Request and responseRecorder. Always use
|
// dns.Msg and responseRecorder. Always use
|
||||||
// NewReplacer to get one of these.
|
// NewReplacer to get one of these.
|
||||||
type Replacer interface {
|
type Replacer interface {
|
||||||
Replace(string) string
|
Replace(string) string
|
||||||
|
|
|
@ -144,7 +144,7 @@ func (s *State) SizeAndDo() *dns.OPT {
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
// Result is the result of Fit.
|
// Result is the result of Scrub.
|
||||||
type Result int
|
type Result int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -180,7 +180,7 @@ func (s *State) Scrub(reply *dns.Msg) (*dns.Msg, Result) {
|
||||||
// Type returns the type of the question as a string.
|
// Type returns the type of the question as a string.
|
||||||
func (s *State) Type() string { return dns.Type(s.Req.Question[0].Qtype).String() }
|
func (s *State) Type() string { return dns.Type(s.Req.Question[0].Qtype).String() }
|
||||||
|
|
||||||
// QType returns the type of the question as a uint16.
|
// QType returns the type of the question as an uint16.
|
||||||
func (s *State) QType() uint16 { return s.Req.Question[0].Qtype }
|
func (s *State) QType() uint16 { return s.Req.Question[0].Qtype }
|
||||||
|
|
||||||
// Name returns the name of the question in the request. Note
|
// Name returns the name of the question in the request. Note
|
||||||
|
|
Loading…
Add table
Reference in a new issue