Commit graph

6 commits

Author SHA1 Message Date
Miek Gieben
de0fa53379 Doc: add package docs ()
* Doc: add package docs

Add short package level docs to make godoc looks nicer.
Add some badges to the README.

* correct url
2016-09-25 08:39:20 +01:00
Miek Gieben
8555716046 Cleanups and tests ()
For some reasons there was a dnsserver/middleware.go that defined
the middleware handlers. This code was a repeat from
middleware/middleware.go. Removed dnsserver/middleware.go and replaced
all uses of dnsserver.Middleware with middleware.Middleware.

Added dnsserver/address_test.go to test the zone normalization (and to
improve the test coverage). The deleted file will also improve the test
coverage :)
2016-09-19 11:26:00 +01:00
Miek Gieben
31851c6acd coredns: default Corefile ()
When no Corefile is given, default to loading the whoami middleware on
the default port (2053).  Also add back the -port flag that allows you
to override the default port.

Further cleanup the startup messages and use caddy's OnStartupComplete()
to blurp out which zones and ports we have.  These can be suppressed
with the -quiet flag.

Normal startup:

miek.nl.:1053
miek.nl2.:1053
example.org.:1054
2016/09/17 20:41:19 [INFO] CoreDNS-001 starting
CoreDNS-001 starting

with the -quiet flag:

2016/09/17 20:41:34 [INFO] CoreDNS-001 starting
2016-09-17 21:24:39 +01:00
Miek Gieben
d1f17fa7e0 Cleanup: put middleware helper functions in pkgs ()
Move all (almost all) Go files in middleware into their
own packages. This makes for better naming and discoverability.

Lot of changes elsewhere to make this change.

The middleware.State was renamed to request.Request which is better,
but still does not cover all use-cases. It was also moved out middleware
because it is used by `dnsserver` as well.

A pkg/dnsutil packages was added for shared, handy, dns util functions.

All normalize functions are now put in normalize.go
2016-09-07 11:10:16 +01:00
Miek Gieben
416603383d Cleanup and fixes ()
* Set version to 001
* Remove k8stest, test fails is k8s is not there: touch luck
* Remove server directory: not used anymore
* Disable k8s test (for now)
* gometalinter changes
2016-08-20 23:03:36 +01:00
Miek Gieben
9ac3cab1b7 Make CoreDNS a server type plugin for Caddy ()
* Make CoreDNS a server type plugin for Caddy

Remove code we don't need and port all middleware over. Fix all tests
and rework the documentation.

Also make `go generate` build a caddy binary which we then copy into
our directory. This means `go build`-builds remain working as-is.

And new etc instances in each etcd test for better isolation.
Fix more tests and rework test.Server with the newer support Caddy offers.

Fix Makefile to support new mode of operation.
2016-08-19 17:14:17 -07:00