cmd/atomdns/handlers/cookie/setup.go
raw| 1 | package cookie |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | |
| 6 | "codeberg.org/miekg/dns/cmd/atomdns/internal/dnsserver" |
| 7 | ) |
| 8 | |
| 9 | func (c *Cookie) Setup(co *dnsserver.Controller) error { |
| 10 | for co.Next() { |
| 11 | args := co.RemainingArgs() |
| 12 | if len(args) == 0 { |
| 13 | return co.PropEmptyErr("secret") |
| 14 | } |
| 15 | c.Secret = strings.Join(args, " ") |
| 16 | } |
| 17 | return nil |
| 18 | } |