Skip to content

Commit

Permalink
Update to match new CoreDNS version
Browse files Browse the repository at this point in the history
Closes #6
  • Loading branch information
serverwentdown committed Jan 24, 2021
1 parent 1313508 commit f0707f5
Show file tree
Hide file tree
Showing 9 changed files with 853 additions and 569 deletions.
6 changes: 3 additions & 3 deletions alias.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package alias

import (
"context"
"math"

"github.com/coredns/coredns/plugin"

"github.com/miekg/dns"
"math"

"golang.org/x/net/context"
)

// Rewrite is plugin to rewrite requests internally before being handled.
Expand Down
4 changes: 2 additions & 2 deletions coredns/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.13
replace github.com/serverwentdown/alias => ../

require (
github.com/coredns/coredns v1.6.9
github.com/miekg/dns v1.1.29
github.com/coredns/coredns v1.8.1
github.com/miekg/dns v1.1.35
github.com/serverwentdown/alias v0.0.0-00010101000000-000000000000
)
693 changes: 434 additions & 259 deletions coredns/go.sum

Large diffs are not rendered by default.

85 changes: 0 additions & 85 deletions coredns/release

This file was deleted.

11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module github.com/serverwentdown/alias

go 1.13
go 1.15

require (
github.com/caddyserver/caddy v1.0.5
github.com/coredns/coredns v1.6.9
github.com/miekg/dns v1.1.29
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
)
github.com/coredns/caddy v1.1.0
github.com/coredns/coredns v1.8.1
github.com/miekg/dns v1.1.35
)
591 changes: 385 additions & 206 deletions go.sum

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ready.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package alias

func (al Alias) Ready() bool { return true }
10 changes: 2 additions & 8 deletions setup.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
package alias

import (
"github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"

"github.com/caddyserver/caddy"
)

func init() {
caddy.RegisterPlugin("alias", caddy.Plugin{
ServerType: "dns",
Action: setup,
})
}
func init() { plugin.Register("alias", setup) }

func setup(c *caddy.Controller) error {
c.Next()
Expand Down
19 changes: 19 additions & 0 deletions setup_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package alias

import (
"testing"

"github.com/coredns/caddy"
)

func TestSetup(t *testing.T) {
c := caddy.NewTestController("dns", `alias`)
if err := setup(c); err != nil {
t.Fatalf("Expected no errors, but got: %v", err)
}

c = caddy.NewTestController("dns", `alias more`)
if err := setup(c); err == nil {
t.Fatalf("Expected errors, but got: %v", err)
}
}

0 comments on commit f0707f5

Please sign in to comment.