summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/routes.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-05-16 16:05:38 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-05-16 16:05:38 -0600
commit1f0c061ce30f218e63fcc17e0fdfc8b90d754ba5 (patch)
treeef148ac39ec520d14342ce48cec07f5efe0379f3 /modules/caddyhttp/routes.go
parentff5b4639d597203f8aec43e5eae8fe3774976d32 (diff)
Architectural shift to using context for config and module state
Diffstat (limited to 'modules/caddyhttp/routes.go')
-rw-r--r--modules/caddyhttp/routes.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/caddyhttp/routes.go b/modules/caddyhttp/routes.go
index cd612ac..d204939 100644
--- a/modules/caddyhttp/routes.go
+++ b/modules/caddyhttp/routes.go
@@ -29,11 +29,11 @@ type ServerRoute struct {
type RouteList []ServerRoute
// Provision sets up all the routes by loading the modules.
-func (routes RouteList) Provision() error {
+func (routes RouteList) Provision(ctx caddy2.Context) error {
for i, route := range routes {
// matchers
for modName, rawMsg := range route.Matchers {
- val, err := caddy2.LoadModule("http.matchers."+modName, rawMsg)
+ val, err := ctx.LoadModule("http.matchers."+modName, rawMsg)
if err != nil {
return fmt.Errorf("loading matcher module '%s': %v", modName, err)
}
@@ -43,7 +43,7 @@ func (routes RouteList) Provision() error {
// middleware
for j, rawMsg := range route.Apply {
- mid, err := caddy2.LoadModuleInline("middleware", "http.middleware", rawMsg)
+ mid, err := ctx.LoadModuleInline("middleware", "http.middleware", rawMsg)
if err != nil {
return fmt.Errorf("loading middleware module in position %d: %v", j, err)
}
@@ -53,7 +53,7 @@ func (routes RouteList) Provision() error {
// responder
if route.Respond != nil {
- resp, err := caddy2.LoadModuleInline("responder", "http.responders", route.Respond)
+ resp, err := ctx.LoadModuleInline("responder", "http.responders", route.Respond)
if err != nil {
return fmt.Errorf("loading responder module: %v", err)
}