28 lines
592 B
Go
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()
|
|
}
|