本文整理汇总了Golang中go/uber/org/yarpc/encoding/thrift.Response类的典型用法代码示例。如果您正苦于以下问题:Golang Response类的具体用法?Golang Response怎么用?Golang Response使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Response类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Echo
func (h handler) Echo(
ctx context.Context,
reqMeta yarpc.ReqMeta,
body wire.Value,
) (thrift.Response, error) {
var args echo.Echo_Echo_Args
if err := args.FromWire(body); err != nil {
return thrift.Response{}, err
}
success, resMeta, err := h.impl.Echo(ctx, reqMeta, args.Ping)
hadError := err != nil
result, err := echo.Echo_Echo_Helper.WrapResponse(success, err)
var response thrift.Response
if err == nil {
response.IsApplicationError = hadError
response.Meta = resMeta
response.Body = result
}
return response, err
}
开发者ID:yarpc,项目名称:yarpc-go,代码行数:23,代码来源:server.go
示例2: TestVoid
func (h handler) TestVoid(
ctx context.Context,
reqMeta yarpc.ReqMeta,
body wire.Value,
) (thrift.Response, error) {
var args gauntlet.ThriftTest_TestVoid_Args
if err := args.FromWire(body); err != nil {
return thrift.Response{}, err
}
resMeta, err := h.impl.TestVoid(ctx, reqMeta)
hadError := err != nil
result, err := gauntlet.ThriftTest_TestVoid_Helper.WrapResponse(err)
var response thrift.Response
if err == nil {
response.IsApplicationError = hadError
response.Meta = resMeta
response.Body = result
}
return response, err
}
开发者ID:yarpc,项目名称:yarpc-go,代码行数:23,代码来源:server.go
示例3: SetValue
func (h handler) SetValue(
ctx context.Context,
reqMeta yarpc.ReqMeta,
body wire.Value,
) (thrift.Response, error) {
var args kv.KeyValue_SetValue_Args
if err := args.FromWire(body); err != nil {
return thrift.Response{}, err
}
resMeta, err := h.impl.SetValue(ctx, reqMeta, args.Key, args.Value)
hadError := err != nil
result, err := kv.KeyValue_SetValue_Helper.WrapResponse(err)
var response thrift.Response
if err == nil {
response.IsApplicationError = hadError
response.Meta = resMeta
response.Body = result
}
return response, err
}
开发者ID:yarpc,项目名称:yarpc-go,代码行数:23,代码来源:server.go
示例4: SecondtestString
func (h handler) SecondtestString(
ctx context.Context,
reqMeta yarpc.ReqMeta,
body wire.Value,
) (thrift.Response, error) {
var args gauntlet.SecondService_SecondtestString_Args
if err := args.FromWire(body); err != nil {
return thrift.Response{}, err
}
success, resMeta, err := h.impl.SecondtestString(ctx, reqMeta, args.Thing)
hadError := err != nil
result, err := gauntlet.SecondService_SecondtestString_Helper.WrapResponse(success, err)
var response thrift.Response
if err == nil {
response.IsApplicationError = hadError
response.Meta = resMeta
response.Body = result
}
return response, err
}
开发者ID:yarpc,项目名称:yarpc-go,代码行数:23,代码来源:server.go
注:本文中的go/uber/org/yarpc/encoding/thrift.Response类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论