Changes needed to support external gRPC server middleware (#498)

The gRPC server middleware[1] needs access to the Server object
in order to push the unpacked Msg through the normal middleware
pipeline. These are the changes to core needed to make that
possible.

[1] https://github.com/infobloxopen/coredns-grpc
This commit is contained in:
John Belamaric
2017-01-31 17:21:55 -05:00
committed by Miek Gieben
parent 439d8b8d12
commit 3a04d2a306
2 changed files with 4 additions and 0 deletions

View File

@@ -21,6 +21,9 @@ type Config struct {
// First consumer is the file middleware to looks for zone files in this place.
Root string
// Server is the server that handles this config
Server *Server
// Middleware stack.
Middleware []middleware.Middleware

View File

@@ -67,6 +67,7 @@ func NewServer(addr string, group []*Config) (*Server, error) {
stack = site.Middleware[i](stack)
}
site.middlewareChain = stack
site.Server = s
}
return s, nil