From e4bfa03f3ec1defd5aa185b096d982c6c4af8572 Mon Sep 17 00:00:00 2001 From: Nixon Date: Tue, 13 Aug 2024 14:58:31 -0700 Subject: [PATCH] improve --- keydb_extension.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/keydb_extension.go b/keydb_extension.go index 05ad779..23b7801 100644 --- a/keydb_extension.go +++ b/keydb_extension.go @@ -9,6 +9,7 @@ import ( "github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" + "github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile" "github.com/caddyserver/caddy/v2/modules/caddyhttp" "github.com/go-redis/redis/v8" ) @@ -94,6 +95,12 @@ func (h *KeyDBHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { return nil } +func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) { + var m KeyDBHandler + err := m.UnmarshalCaddyfile(h.Dispenser) + return m, err +} + var ( _ caddy.Provisioner = (*KeyDBHandler)(nil) _ caddyhttp.MiddlewareHandler = (*KeyDBHandler)(nil)