Documentation
¶
Index ¶
- Constants
- func CoerceInt(v reflect.Value) int64
- func CoerceUint(v reflect.Value) uint64
- func HandleRPCRequest(req reflect.Value) (int, string, []reflect.Value, error)
- func ReceiveResponse(reader io.Reader) (int, reflect.Value, error)
- func SendErrorResponseMessage(writer io.Writer, msgId int, errMsg string) error
- func SendRequestMessage(writer io.Writer, msgId int, funcName string, arguments []interface{}) error
- func SendResponseMessage(writer io.Writer, msgId int, value reflect.Value) error
- type FunctionResolver
- type Server
- type Session
Constants ¶
const ( REQUEST = 0 RESPONSE = 1 NOTIFICATION = 2 )
Variables ¶
This section is empty.
Functions ¶
func CoerceInt ¶
CoerceInt takes a reflected value and returns it as an int64 panics if not an integer type
func CoerceUint ¶
CoerceUint takes a reflected value and returns it as an uint64 panics if not an integer type
func HandleRPCRequest ¶
This is a low-level function that is not supposed to be called directly by the user. Change this if the MessagePack protocol is updated.
func ReceiveResponse ¶
This is a low-level function that is not supposed to be called directly by the user. Change this if the MessagePack protocol is updated.
func SendErrorResponseMessage ¶
This is a low-level function that is not supposed to be called directly by the user. Change this if the MessagePack protocol is updated.
Types ¶
type FunctionResolver ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(resolver FunctionResolver, autoCoercing bool, _log *log.Logger) *Server
Creates a new Server instance. raw bytesc are automatically converted into strings if autoCoercing is enabled.
func (*Server) Listen ¶
Listenes on the specified transport. A single server can listen on the multiple ports.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(transport io.ReadWriteCloser, autoCoercing bool) *Session
Creates a new session with the specified connection. Strings are automatically converted into raw bytes if autoCoercing is enabled.