|
16 | 16 | //
|
17 | 17 | // To use this package:
|
18 | 18 | //
|
19 |
| -// 1. Set the AppName and AppVersion variables. |
20 |
| -// 2. Call LoadCaddyfile() to get the Caddyfile. |
21 |
| -// Pass in the name of the server type (like "http"). |
22 |
| -// Make sure the server type's package is imported |
23 |
| -// (import _ "github.com/coredns/caddy/caddyhttp"). |
24 |
| -// 3. Call caddy.Start() to start Caddy. You get back |
25 |
| -// an Instance, on which you can call Restart() to |
26 |
| -// restart it or Stop() to stop it. |
| 19 | +// 1. Set the AppName and AppVersion variables. |
| 20 | +// 2. Call LoadCaddyfile() to get the Caddyfile. |
| 21 | +// Pass in the name of the server type (like "http"). |
| 22 | +// Make sure the server type's package is imported |
| 23 | +// (import _ "github.com/coredns/caddy/caddyhttp"). |
| 24 | +// 3. Call caddy.Start() to start Caddy. You get back |
| 25 | +// an Instance, on which you can call Restart() to |
| 26 | +// restart it or Stop() to stop it. |
27 | 27 | //
|
28 | 28 | // You should call Wait() on your instance to wait for
|
29 | 29 | // all servers to quit before your process exits.
|
@@ -113,6 +113,7 @@ type Instance struct {
|
113 | 113 | OnRestartFailed []func() error // if restart failed
|
114 | 114 | OnShutdown []func() error // stopping, even as part of a restart
|
115 | 115 | OnFinalShutdown []func() error // stopping, not as part of a restart
|
| 116 | + OnUpgrade []func() error // stopping, not as part of a shutdown |
116 | 117 |
|
117 | 118 | // storing values on an instance is preferable to
|
118 | 119 | // global state because these will get garbage-
|
|
0 commit comments