rpc/server/server_handler.go
crusader 8e43174376 ing
2017-10-31 18:25:44 +09:00

28 lines
592 B
Go

package server
import (
"io"
"git.loafle.net/commons_go/rpc/protocol"
)
type ServerHandler interface {
RegisterCodec(codec protocol.ServerCodec, contentType string)
GetContentType(r io.Reader) 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)
Validate()
}