Documentation
¶
Index ¶
- type CaddyfileBlockParser
- type FuncsProvider
- type XTemplateModule
- func (XTemplateModule) CaddyModule() caddy.ModuleInfo
- func (m *XTemplateModule) Cleanup() error
- func (m *XTemplateModule) Provision(ctx caddy.Context) error
- func (m *XTemplateModule) ServeHTTP(w http.ResponseWriter, r *http.Request, _ caddyhttp.Handler) error
- func (m *XTemplateModule) UnmarshalJSON(data []byte) error
- func (m *XTemplateModule) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaddyfileBlockParser ¶ added in v0.11.0
type CaddyfileBlockParser interface {
ParseCaddyfile(h httpcaddyfile.Helper) (json.RawMessage, error)
}
CaddyfileBlockParser is implemented by Caddy modules in the "xtemplate.providers.*" and "xtemplate.controller.*" namespaces that want to expose Caddyfile block syntax. ParseCaddyfile must return a JSON object containing only the type-specific fields. Reserved keys are injected by the dispatch (providers: "type" and "name"; controllers: "type").
type FuncsProvider ¶ added in v0.9.0
FuncsProvider is implemented by Caddy modules in the `xtemplate.funcs` namespace. Such a module contributes additional functions to the xtemplate template execution context. Reference one by its module name (the final segment of its module ID) in the `funcs_modules` config field.
type XTemplateModule ¶
type XTemplateModule struct {
xtemplate.Config
FuncsModules []string `json:"funcs_modules,omitempty"`
// contains filtered or unexported fields
}
func (XTemplateModule) CaddyModule ¶
func (XTemplateModule) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*XTemplateModule) Cleanup ¶
func (m *XTemplateModule) Cleanup() error
Cleanup discards resources held by t. Implements caddy.CleanerUpper. Stops the xtemplate Server so instance providers and contexts tear down even though Caddy never calls Serve (handler-only embed).
func (*XTemplateModule) Provision ¶
func (m *XTemplateModule) Provision(ctx caddy.Context) error
Provision implements caddy.Provisioner.
func (*XTemplateModule) ServeHTTP ¶
func (m *XTemplateModule) ServeHTTP(w http.ResponseWriter, r *http.Request, _ caddyhttp.Handler) error
func (*XTemplateModule) UnmarshalJSON ¶ added in v0.11.0
func (m *XTemplateModule) UnmarshalJSON(data []byte) error
UnmarshalJSON applies the ban-list then unmarshals. Uses a method-less Config alias so embedded UnmarshalJSON does not swallow module-only fields (funcs_modules).
func (*XTemplateModule) Validate ¶
func (m *XTemplateModule) Validate() error
Validate ensures t has a valid configuration. Implements caddy.Validator.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package standard links the default Caddyfile parsers (providers + controllers), the pure-Go sqlite3 driver, and the xtemplate caddy module.
|
Package standard links the default Caddyfile parsers (providers + controllers), the pure-Go sqlite3 driver, and the xtemplate caddy module. |