From f304a07a8cfe67b2a65f95f27eb10a9b854c4ef8 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Sat, 28 May 2022 16:53:20 +0300 Subject: Improved middlewares --- rpc/wrapper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rpc/wrapper.go') diff --git a/rpc/wrapper.go b/rpc/wrapper.go index 1d6361c..8aa9556 100644 --- a/rpc/wrapper.go +++ b/rpc/wrapper.go @@ -24,7 +24,7 @@ import ( "encoding/json" ) -func H[RQ any, RS any](handler func(context.Context, *RQ) (RS, error)) Handler { +func H[RQ any, RS any](handler func(context.Context, *RQ) (RS, error)) HandlerFunc { return func(ctx context.Context, in json.RawMessage) (json.RawMessage, error) { req := new(RQ) if err := json.Unmarshal(in, req); err != nil { @@ -41,4 +41,4 @@ func H[RQ any, RS any](handler func(context.Context, *RQ) (RS, error)) Handler { } } -type Handler func(context.Context, json.RawMessage) (json.RawMessage, error) +type HandlerFunc func(context.Context, json.RawMessage) (json.RawMessage, error) -- cgit v1.2.3