improve
This commit is contained in:
parent
a4ff4b238f
commit
e4bfa03f3e
1 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
|
|
||||||
"github.com/caddyserver/caddy/v2"
|
"github.com/caddyserver/caddy/v2"
|
||||||
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
|
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
|
||||||
|
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
|
||||||
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
|
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
)
|
)
|
||||||
|
@ -94,6 +95,12 @@ func (h *KeyDBHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) {
|
||||||
|
var m KeyDBHandler
|
||||||
|
err := m.UnmarshalCaddyfile(h.Dispenser)
|
||||||
|
return m, err
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
_ caddy.Provisioner = (*KeyDBHandler)(nil)
|
_ caddy.Provisioner = (*KeyDBHandler)(nil)
|
||||||
_ caddyhttp.MiddlewareHandler = (*KeyDBHandler)(nil)
|
_ caddyhttp.MiddlewareHandler = (*KeyDBHandler)(nil)
|
||||||
|
|
Loading…
Reference in a new issue