overflow_discovery/server/rpc/server_handlers.go
crusader 9775e5ea4e ing
2017-10-31 19:27:26 +09:00

48 lines
858 B
Go

package rpc
import (
"io"
"git.loafle.net/commons_go/rpc"
rpcServer "git.loafle.net/commons_go/rpc/server"
)
func NewServerHandler(registry rpc.Registry) *ServerHandlers {
sh := &ServerHandlers{}
sh.RPCRegistry = registry
return sh
}
type ServerHandlers struct {
rpcServer.ServerHandlers
}
func (sh *ServerHandlers) GetContentType(r io.Reader) string {
return "json"
}
func (sh *ServerHandlers) OnPreRead(r io.Reader) {
// no op
}
func (sh *ServerHandlers) OnPostRead(r io.Reader) {
// no op
}
func (sh *ServerHandlers) OnPreWriteResult(w io.Writer, result interface{}) {
// no op
}
func (sh *ServerHandlers) OnPostWriteResult(w io.Writer, result interface{}) {
// no op
}
func (sh *ServerHandlers) OnPreWriteError(w io.Writer, err error) {
// no op
}
func (sh *ServerHandlers) OnPostWriteError(w io.Writer, err error) {
// no op
}