mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
middleware/auto: add (#333)
Add auto-load middleware that automatically picks up zones. Every X seconds it will scan for new zones. Add tests and documentation. Make 'make test' use -race.
This commit is contained in:
@@ -33,7 +33,7 @@ func setup(c *caddy.Controller) error {
|
||||
if len(z.TransferTo) > 0 {
|
||||
z.Notify()
|
||||
}
|
||||
z.Reload(nil)
|
||||
z.Reload()
|
||||
})
|
||||
return nil
|
||||
})
|
||||
@@ -99,7 +99,7 @@ func fileParse(c *caddy.Controller) (Zones, error) {
|
||||
case "no_reload":
|
||||
noReload = true
|
||||
}
|
||||
// discard from, here, maybe check and show log when we do?
|
||||
|
||||
for _, origin := range origins {
|
||||
if t != nil {
|
||||
z[origin].TransferTo = append(z[origin].TransferTo, t...)
|
||||
@@ -113,8 +113,6 @@ func fileParse(c *caddy.Controller) (Zones, error) {
|
||||
}
|
||||
|
||||
// TransferParse parses transfer statements: 'transfer to [address...]'.
|
||||
// Exported so secondary can use this as well. For the `file` middleware transfer from does
|
||||
// not make sense; make this an error.
|
||||
func TransferParse(c *caddy.Controller, secondary bool) (tos, froms []string, err error) {
|
||||
what := c.Val()
|
||||
if !c.NextArg() {
|
||||
|
||||
Reference in New Issue
Block a user