本文整理匯總了Golang中github.com/youtube/vitess/go/mysql/proto.Proto3ToQueryResults函數的典型用法代碼示例。如果您正苦於以下問題:Golang Proto3ToQueryResults函數的具體用法?Golang Proto3ToQueryResults怎麽用?Golang Proto3ToQueryResults使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Proto3ToQueryResults函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ExecuteBatchKeyspaceIds
func (conn *vtgateConn) ExecuteBatchKeyspaceIds(ctx context.Context, queries []proto.BoundKeyspaceIdQuery, tabletType pbt.TabletType, asTransaction bool, session interface{}) ([]mproto.QueryResult, interface{}, error) {
var s *pb.Session
if session != nil {
s = session.(*pb.Session)
}
qs, err := proto.BoundKeyspaceIdQueriesToProto(queries)
if err != nil {
return nil, session, err
}
request := &pb.ExecuteBatchKeyspaceIdsRequest{
CallerId: callerid.EffectiveCallerIDFromContext(ctx),
Session: s,
Queries: qs,
TabletType: tabletType,
AsTransaction: asTransaction,
}
response, err := conn.c.ExecuteBatchKeyspaceIds(ctx, request)
if err != nil {
return nil, session, vterrors.FromGRPCError(err)
}
if response.Error != nil {
return nil, response.Session, vterrors.FromVtRPCError(response.Error)
}
return mproto.Proto3ToQueryResults(response.Results), response.Session, nil
}
示例2: ExecuteBatchKeyspaceIds
func (conn *vtgateConn) ExecuteBatchKeyspaceIds(ctx context.Context, queries []proto.BoundKeyspaceIdQuery, tabletType topo.TabletType, asTransaction bool, session interface{}) ([]mproto.QueryResult, interface{}, error) {
var s *pb.Session
if session != nil {
s = session.(*pb.Session)
}
request := &pb.ExecuteBatchKeyspaceIdsRequest{
Session: s,
Queries: proto.BoundKeyspaceIdQueriesToProto(queries),
TabletType: topo.TabletTypeToProto(tabletType),
AsTransaction: asTransaction,
}
response, err := conn.c.ExecuteBatchKeyspaceIds(ctx, request)
if err != nil {
return nil, session, err
}
if response.Error != nil {
return nil, response.Session, vterrors.FromVtRPCError(response.Error)
}
return mproto.Proto3ToQueryResults(response.Results), response.Session, nil
}
示例3: ExecuteBatchKeyspaceIds
func (conn *vtgateConn) ExecuteBatchKeyspaceIds(ctx context.Context, queries []proto.BoundKeyspaceIdQuery, tabletType topopb.TabletType, asTransaction bool, session interface{}) ([]mproto.QueryResult, interface{}, error) {
var s *pb.Session
if session != nil {
s = session.(*pb.Session)
}
request := &pb.ExecuteBatchKeyspaceIdsRequest{
CallerId: callerid.EffectiveCallerIDFromContext(ctx),
Queries: proto.BoundKeyspaceIdQueriesToProto(queries),
TabletType: tabletType,
AsTransaction: asTransaction,
Session: s,
}
response := &pb.ExecuteBatchKeyspaceIdsResponse{}
if err := conn.rpcConn.Call(ctx, "VTGateP3.ExecuteBatchKeyspaceIds", request, response); err != nil {
return nil, session, err
}
if err := vterrors.FromVtRPCError(response.Error); err != nil {
return nil, response.Session, err
}
return mproto.Proto3ToQueryResults(response.Results), response.Session, nil
}