Debian Codegraph @

cmd/atomdns/handlers/random/setup.go

raw
1 package random
2
3 import (
4 "fmt"
5
6 "codeberg.org/miekg/dns/cmd/atomdns/internal/dnsserver"
7 )
8
9 func (r *Random) Setup(co *dnsserver.Controller) error {
10 for co.Next() {
11 args := co.RemainingArgs()
12 if len(args) == 0 {
13 return nil
14 }
15 if len(args) > 1 {
16 return co.ArgErr()
17 }
18 if args[0] != "random" {
19 return co.PropErr(fmt.Errorf("policy can only be '%s'", "random"))
20 }
21 }
22 return nil
23 }