From 1127a3b64d606e7c4aa4b01bbd1bdb1efa903b34 Mon Sep 17 00:00:00 2001 From: Matt Holt Date: Mon, 19 Sep 2016 17:44:12 -0600 Subject: [PATCH] Updated Writing a Plugin: Directives (markdown) --- Writing-a-Plugin:-Directives.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Writing-a-Plugin:-Directives.md b/Writing-a-Plugin:-Directives.md index 19c1e4e..936a419 100644 --- a/Writing-a-Plugin:-Directives.md +++ b/Writing-a-Plugin:-Directives.md @@ -7,6 +7,7 @@ Directives can do things like run code when the server starts or shuts down, cha 1. Create a new Go package 2. Implement a Setup Function 3. Order your Directive +4. Plug in your Plugin (applies to any plugin) ## 1. Create a new Go package @@ -80,6 +81,8 @@ The last thing you have to do is tell the server type where in the process to ex Each server type has a list of strings where each item is the name of a directive. For instance, see [the HTTP server's list](https://github.com/mholt/caddy/blob/d3860f95f59b5f18e14ddf3d67b4c44dbbfdb847/caddyhttp/httpserver/plugin.go#L314-L355) of supported directives. Add your directive to the list in the proper place. +## 4. Plug in your Plugin + Finally, don't forget to import your plugin's package! Caddy must import your plugin to register and execute it. This is usually done within [run.go](https://github.com/mholt/caddy/blob/master/caddy/caddymain/run.go): ```go