diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2022-05-28 16:53:20 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2022-05-28 16:53:20 +0300 |
commit | f304a07a8cfe67b2a65f95f27eb10a9b854c4ef8 (patch) | |
tree | 9e6a7e9ea6b8d600cccac5a5d50f3232d631d073 /rpc/wrapper.go | |
parent | 281eda83c9f4bcb06318444df3574df0840205fa (diff) |
Improved middlewares
Diffstat (limited to 'rpc/wrapper.go')
-rw-r--r-- | rpc/wrapper.go | 4 |
1 files changed, 2 insertions, 2 deletions
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) |