本文整理汇总了Golang中github.com/youtube/vitess/go/vt/proto/vtgateservice.Vitess_StreamExecuteShardsServer.Send方法的典型用法代码示例。如果您正苦于以下问题:Golang Vitess_StreamExecuteShardsServer.Send方法的具体用法?Golang Vitess_StreamExecuteShardsServer.Send怎么用?Golang Vitess_StreamExecuteShardsServer.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/youtube/vitess/go/vt/proto/vtgateservice.Vitess_StreamExecuteShardsServer
的用法示例。
在下文中一共展示了Vitess_StreamExecuteShardsServer.Send方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: StreamExecuteShards
// StreamExecuteShards is the RPC version of vtgateservice.VTGateService method
func (vtg *VTGate) StreamExecuteShards(request *pb.StreamExecuteShardsRequest, stream pbs.Vitess_StreamExecuteShardsServer) (err error) {
defer vtg.server.HandlePanic(&err)
query := &proto.QueryShard{
Sql: string(request.Query.Sql),
BindVariables: tproto.Proto3ToBindVariables(request.Query.BindVariables),
Keyspace: request.Keyspace,
Shards: request.Shards,
TabletType: topo.ProtoToTabletType(request.TabletType),
}
return vtg.server.StreamExecuteShard(stream.Context(), query, func(value *proto.QueryResult) error {
return stream.Send(&pb.StreamExecuteShardsResponse{
Result: mproto.QueryResultToProto3(value.Result),
})
})
}
示例2: StreamExecuteShards
// StreamExecuteShards is the RPC version of vtgateservice.VTGateService method
func (vtg *VTGate) StreamExecuteShards(request *pb.StreamExecuteShardsRequest, stream pbs.Vitess_StreamExecuteShardsServer) (err error) {
defer vtg.server.HandlePanic(&err)
ctx := callerid.NewContext(callinfo.GRPCCallInfo(stream.Context()),
request.CallerId,
callerid.NewImmediateCallerID("grpc client"))
return vtg.server.StreamExecuteShards(ctx,
string(request.Query.Sql),
tproto.Proto3ToBindVariables(request.Query.BindVariables),
request.Keyspace,
request.Shards,
request.TabletType,
func(value *proto.QueryResult) error {
return stream.Send(&pb.StreamExecuteShardsResponse{
Result: mproto.QueryResultToProto3(value.Result),
})
})
}
示例3: StreamExecuteShards
// StreamExecuteShards is the RPC version of vtgateservice.VTGateService method
func (vtg *VTGate) StreamExecuteShards(request *vtgatepb.StreamExecuteShardsRequest, stream vtgateservicepb.Vitess_StreamExecuteShardsServer) (err error) {
defer vtg.server.HandlePanic(&err)
ctx := withCallerIDContext(stream.Context(), request.CallerId)
bv, err := querytypes.Proto3ToBindVariables(request.Query.BindVariables)
if err != nil {
return vterrors.ToGRPCError(err)
}
vtgErr := vtg.server.StreamExecuteShards(ctx,
string(request.Query.Sql),
bv,
request.Keyspace,
request.Shards,
request.TabletType,
func(value *sqltypes.Result) error {
return stream.Send(&vtgatepb.StreamExecuteShardsResponse{
Result: sqltypes.ResultToProto3(value),
})
})
return vterrors.ToGRPCError(vtgErr)
}