rpc/server/server_handler.go
crusader fda60823d6 ing
2017-11-01 15:17:32 +09:00

27 lines
636 B
Go

package server
import (
"io"
"git.loafle.net/commons_go/rpc/protocol"
"git.loafle.net/commons_go/server"
)
type ServerHandler interface {
server.ServerHandler
GetContentType(r io.Reader) string
RegisterCodec(codec protocol.ServerCodec, contentType string)
OnPreRead(r io.Reader)
OnPostRead(r io.Reader)
OnPreWriteResult(w io.Writer, result interface{})
OnPostWriteResult(w io.Writer, result interface{})
OnPreWriteError(w io.Writer, err error)
OnPostWriteError(w io.Writer, err error)
getCodec(contentType string) (protocol.ServerCodec, error)
invoke(codec protocol.RegistryCodec) (result interface{}, err error)
}