good morning!!!!

Skip to content
Snippets Groups Projects
Verified Commit 60f97645 authored by a's avatar a
Browse files

ok

parent 09c5b11c
No related branches found
No related tags found
Loading
package codec
// http.handler, but for jrpc
type Handler interface {
ServeRPC(w ResponseWriter, r *Request)
}
// http.HandlerFunc,but for jrpc
type HandlerFunc func(w ResponseWriter, r *Request)
func (fn HandlerFunc) ServeRPC(w ResponseWriter, r *Request) {
(fn)(w, r)
}
...@@ -5,6 +5,18 @@ import ( ...@@ -5,6 +5,18 @@ import (
"io" "io"
) )
// http.handler, but for jrpc
type Handler interface {
ServeRPC(w ResponseWriter, r *Request)
}
// http.HandlerFunc,but for jrpc
type HandlerFunc func(w ResponseWriter, r *Request)
func (fn HandlerFunc) ServeRPC(w ResponseWriter, r *Request) {
(fn)(w, r)
}
type Doer interface { type Doer interface {
Do(ctx context.Context, result any, method string, params any) error Do(ctx context.Context, result any, method string, params any) error
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment