Documentation ¶
Index ¶
- type DynamicHandler
- func (DynamicHandler) CaddyModule() caddy.ModuleInfo
- func (dh *DynamicHandler) Cleanup() error
- func (dh *DynamicHandler) Provision(ctx caddy.Context) error
- func (dh *DynamicHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (dh *DynamicHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (dh *DynamicHandler) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamicHandler ¶
type DynamicHandler struct { // The plugin name (as well as the Go package name). Name string `json:"name,omitempty"` // The root path of the plugin code. Defaults to the directory of the Caddyfile. // // The full path of the plugin code: // // - Root is an absolute path: `<root>/<name>/<name>.go` // - Root is a relative path: `<dir_to_caddyfile>/<root>/<name>/<name>.go` Root string `json:"root,omitempty"` // The plugin configuration in JSON format. Config string `json:"config,omitempty"` // contains filtered or unexported fields }
DynamicHandler implements a handler that can execute plugins (written in Go) dynamically.
func (DynamicHandler) CaddyModule ¶
func (DynamicHandler) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*DynamicHandler) Cleanup ¶
func (dh *DynamicHandler) Cleanup() error
Cleanup implements caddy.CleanerUpper.
func (*DynamicHandler) Provision ¶
func (dh *DynamicHandler) Provision(ctx caddy.Context) error
Provision implements caddy.Provisioner.
func (*DynamicHandler) ServeHTTP ¶
func (dh *DynamicHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
ServeHTTP implements caddyhttp.MiddlewareHandler.
func (*DynamicHandler) UnmarshalCaddyfile ¶
func (dh *DynamicHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler. Syntax:
dynamic_handler <name> { root <root> config <config> }
func (*DynamicHandler) Validate ¶
func (dh *DynamicHandler) Validate() error
Validate implements caddy.Validator.
Click to show internal directories.
Click to hide internal directories.