Example #1
0
func (c *client) unmarshaler(rsp mercury.Response, protocol interface{}) tmsg.Unmarshaler {
	result := marshaling.Unmarshaler(rsp.Headers()[marshaling.ContentTypeHeader], protocol)
	if result == nil { // Default to proto
		result = marshaling.Unmarshaler(marshaling.ProtoContentType, protocol)
	}
	return result
}
Example #2
0
func (e Endpoint) unmarshaler(req mercury.Request) tmsg.Unmarshaler {
	result := marshaling.Unmarshaler(req.Headers()[marshaling.ContentTypeHeader], e.Request)
	if result == nil { // Default to json
		result = marshaling.Unmarshaler(marshaling.JSONContentType, e.Request)
	}
	return result
}
Example #3
0
func (e Endpoint) unmarshaler(req mercury.Request) tmsg.Unmarshaler {
	return marshaling.Unmarshaler(req.Headers()[marshaling.ContentTypeHeader], e.Request)
}