func old2NewResponse(req typhon.Request, oldRsp mercury.Response) typhon.Response { rsp := typhon.NewResponse(req) rsp.Header = toHeader(oldRsp.Headers()) rsp.Write(oldRsp.Payload()) rsp.Error = oldRsp.Error() return rsp }
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 }