22 lines
682 B
Go
22 lines
682 B
Go
|
package rpc
|
||
|
|
||
|
import "git.loafle.net/commons_go/rpc/protocol"
|
||
|
|
||
|
type ServletHandler interface {
|
||
|
Init() error
|
||
|
|
||
|
GetRequest(codec protocol.ServerCodec, reader interface{}) (protocol.ServerRequestCodec, error)
|
||
|
Invoke(requestCodec protocol.RegistryCodec) (result interface{}, err error)
|
||
|
SendResponse(requestCodec protocol.ServerRequestCodec, writer interface{}, result interface{}, err error) error
|
||
|
SendNotification(codec protocol.ServerCodec, writer interface{}, method string, args ...interface{}) error
|
||
|
|
||
|
Destroy()
|
||
|
|
||
|
RegisterCodec(contentType string, codec protocol.ServerCodec)
|
||
|
|
||
|
getCodec(contentType string) (protocol.ServerCodec, error)
|
||
|
|
||
|
GetPendingMessages() int
|
||
|
Validate()
|
||
|
}
|