mirror of
https://github.com/caddyserver/caddy.git
synced 2025-07-09 03:04:57 -04:00
Updated Writing a Plugin: Directives (markdown)
parent
749b2e27cd
commit
aad4a813bf
@ -83,13 +83,13 @@ Each server type has a list of strings where each item is the name of a directiv
|
||||
|
||||
## 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):
|
||||
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) at the end of the `import` section:
|
||||
|
||||
```go
|
||||
import _ "your/plugin/package/here"
|
||||
_ "your/plugin/package/here"
|
||||
```
|
||||
|
||||
*Please Note:* The `_` after import is required.
|
||||
*Please Note:* The `_` before the package name is required.
|
||||
|
||||
That's it! Build caddy with your plugin, then write a Caddyfile with your new directive to see it in action.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user