From 74e70eb910acea0fafb50e26809602c165bcdfd0 Mon Sep 17 00:00:00 2001 From: Sandeep Renjith <33704221+sandeeprenjith@users.noreply.github.com> Date: Thu, 1 Nov 2018 21:12:00 +0530 Subject: [PATCH] Update enable-disable-plugins.md (#115) Found typos on lines 33 and 42 --- content/blog/enable-disable-plugins.md | 144 ++++++++++++------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/content/blog/enable-disable-plugins.md b/content/blog/enable-disable-plugins.md index 07f3ef0..08f30c9 100644 --- a/content/blog/enable-disable-plugins.md +++ b/content/blog/enable-disable-plugins.md @@ -12,75 +12,75 @@ disabled on the fly by specifying (or not specifying) it in the [Corefile](/2017/07/23/corefile-explained/). But you can also compile CoreDNS with only the plugin you *need* and leave the rest completely out. - -There are two ways to achieve that. It could be done via compile-time configuration file -with CoreDNS code base update. It also could be achieved without modifying CoreDNS code. - -## Build with compile-time configuration file - -The with compile-time configuration file, -[`plugin.cfg`](https://github.com/coredns/coredns/blob/master/plugin.cfg) is all you need -to update. It looks like this: - -~~~ -... -whoami:whoami -erratic:erratic -startup:github.com/mholt/caddy/startupshutdown -... -~~~ - -The ordering of the plugins is specified by how the are ordered in this file. Each line consists of -a **name** and a **repository**. Just add or remove your plugin in this file. - -Then do a `go get ` if you need to get the external plugin's source code. And then -just compile CoreDNS with `go generate` and a `go build`. You can then check if CoreDNS has the new -plugin with `coredns -plugins`. - -## Build with external golang source code - -Alternatively, you could assembly plugins from different places through an external golang program. -It looks like this: - -~~~ -package main - -import ( - _ "github.com/coredns/example" - - "github.com/coredns/coredns/coremain" - "github.com/coredns/coredns/core/dnsserver" -) - -var directives = []string{ - "example", - ... - ... - "whoami", - "startup", - "shutdown", -} - -func init() { - dnsserver.Directives = directives -} - -func main() { - coremain.Run() -} -~~~ - -In the above sample code, the external plugin `example` has been imported with: -~~~ - _ "github.com/coredns/example" -~~~ - -The directives should also be updated through: -~~~ - dnsserver.Directives = directives -~~~ - -The ordering of the plugins is specified by how the arey ordered in the slice `directives`. - -Then you can just compile CoreDNS with `go build` to have the binary generated with the -plugins you selected. + +There are two ways to achieve that. It could be done via compile-time configuration file +with CoreDNS code base update. It also could be achieved without modifying CoreDNS code. + +## Build with compile-time configuration file + +The with compile-time configuration file, +[`plugin.cfg`](https://github.com/coredns/coredns/blob/master/plugin.cfg) is all you need +to update. It looks like this: + +~~~ +... +whoami:whoami +erratic:erratic +startup:github.com/mholt/caddy/startupshutdown +... +~~~ + +The ordering of the plugins is specified by how they are ordered in this file. Each line consists of +a **name** and a **repository**. Just add or remove your plugin in this file. + +Then do a `go get ` if you need to get the external plugin's source code. And then +just compile CoreDNS with `go generate` and a `go build`. You can then check if CoreDNS has the new +plugin with `coredns -plugins`. + +## Build with external golang source code + +Alternatively, you could assemble plugins from different places through an external golang program. +It looks like this: + +~~~ +package main + +import ( + _ "github.com/coredns/example" + + "github.com/coredns/coredns/coremain" + "github.com/coredns/coredns/core/dnsserver" +) + +var directives = []string{ + "example", + ... + ... + "whoami", + "startup", + "shutdown", +} + +func init() { + dnsserver.Directives = directives +} + +func main() { + coremain.Run() +} +~~~ + +In the above sample code, the external plugin `example` has been imported with: +~~~ + _ "github.com/coredns/example" +~~~ + +The directives should also be updated through: +~~~ + dnsserver.Directives = directives +~~~ + +The ordering of the plugins is specified by how the arey ordered in the slice `directives`. + +Then you can just compile CoreDNS with `go build` to have the binary generated with the +plugins you selected.