rpc/server/handle.go
crusader b284554280 ing
2017-11-08 15:35:27 +09:00

15 lines
350 B
Go

package server
import (
"io"
"git.loafle.net/commons_go/rpc"
"git.loafle.net/commons_go/rpc/protocol"
)
func Handle(sh ServerHandler, codec protocol.ServerCodec, r io.Reader, w io.Writer) error {
return rpc.Handle(sh, codec, r, w, func(codecReq protocol.ServerCodecRequest) (result interface{}, err error) {
return sh.Invoke(codecReq)
})
}