rpc/server/server_handler.go

27 lines
636 B
Go
Raw Normal View History

2017-10-31 09:25:44 +00:00
package server
import (
"io"
"git.loafle.net/commons_go/rpc/protocol"
2017-11-01 06:17:32 +00:00
"git.loafle.net/commons_go/server"
2017-10-31 09:25:44 +00:00
)
type ServerHandler interface {
2017-11-01 06:17:32 +00:00
server.ServerHandler
2017-10-31 09:25:44 +00:00
GetContentType(r io.Reader) string
2017-11-01 06:17:32 +00:00
RegisterCodec(codec protocol.ServerCodec, contentType string)
2017-10-31 09:25:44 +00:00
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)
}