rpc/server/rpc_server_handler.go
crusader 00dff62f10 ing
2017-11-02 15:39:30 +09:00

25 lines
581 B
Go

package server
import (
"io"
"git.loafle.net/commons_go/rpc/protocol"
)
type RPCServerHandler interface {
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)
}