overflow_discovery/server/rpc/server_handlers.go

48 lines
858 B
Go
Raw Normal View History

2017-10-31 10:27:26 +00:00
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
}