mirror of
https://github.com/coredns/coredns.git
synced 2025-11-03 02:33:21 -05:00
middleware.md: put in the same doc
Move middleware/middleware.md to middleware.md. This should be the canonical place where to document how middlewares should look and act.
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
# Writing middleware
|
# Middleware
|
||||||
|
|
||||||
|
## Writing Middleware
|
||||||
|
|
||||||
From the Caddy docs:
|
From the Caddy docs:
|
||||||
|
|
||||||
@@ -26,3 +28,29 @@ So CoreDNS treats:
|
|||||||
|
|
||||||
as special and will then assume nothing has written to the client. In all other cases it is assumes
|
as special and will then assume nothing has written to the client. In all other cases it is assumes
|
||||||
something has been written to the client (by the middleware).
|
something has been written to the client (by the middleware).
|
||||||
|
|
||||||
|
## Hooking it up
|
||||||
|
|
||||||
|
TODO(miek): text here on how to hook up middleware.
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
|
||||||
|
Each middleware should have a README.md explaining what the middleware does and how it is
|
||||||
|
configured. The file should have the following layout:
|
||||||
|
|
||||||
|
* Title: use the middleware's name
|
||||||
|
* Subsection titled: "Syntax"
|
||||||
|
* Subsection titled: "Examples"
|
||||||
|
|
||||||
|
More sections are of course possible.
|
||||||
|
|
||||||
|
## Style
|
||||||
|
|
||||||
|
We use the Unix manual page style:
|
||||||
|
|
||||||
|
* The name of middleware in the running text should be italic: *middleware*.
|
||||||
|
* all CAPITAL: user supplied argument, in the running text references this use strong text: `**`:
|
||||||
|
**EXAMPLE**.
|
||||||
|
* Optional text: in block quotes: `[optional]`.
|
||||||
|
* Use three dots to indicate multiple options are allowed: `arg...`.
|
||||||
|
* Item used literal: `literal`.
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
# Middleware
|
|
||||||
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
Each middleware should have a README.md explaining what the middleware does and how it is
|
|
||||||
configured. The file should have the following layout:
|
|
||||||
|
|
||||||
* Title: use the middleware's name
|
|
||||||
* Subsection titled: "Syntax"
|
|
||||||
* Subsection titled: "Examples"
|
|
||||||
|
|
||||||
More sections are of course possible.
|
|
||||||
|
|
||||||
## Style
|
|
||||||
|
|
||||||
We use the Unix manual page style:
|
|
||||||
|
|
||||||
* The name of middleware in the running text should be italic: *middleware*.
|
|
||||||
* all CAPITAL: user supplied argument, in the running text references this use strong text: `**`:
|
|
||||||
**EXAMPLE**.
|
|
||||||
* Optional text: in block quotes: `[optional]`.
|
|
||||||
* Use three dots to indicate multiple options are allowed: `arg...`.
|
|
||||||
* Item used literal: `literal`.
|
|
||||||
Reference in New Issue
Block a user