Documentation ¶
Index ¶
- func BoundKeyspaceIdQueriesToProto(bsq []BoundKeyspaceIdQuery) []*pb.BoundKeyspaceIdQuery
- func BoundShardQueriesToProto(bsq []BoundShardQuery) []*pb.BoundShardQuery
- func EntityIdsToProto(l []EntityId) []*pb.ExecuteEntityIdsRequest_EntityId
- func SessionToProto(s *Session) *pb.Session
- type BatchQueryShard
- type BeginRequest
- type BeginResponse
- type BoundKeyspaceIdQuery
- type BoundShardQuery
- type CommitRequest
- type CommitResponse
- type EntityId
- type EntityIdsQuery
- type GetSrvKeyspaceRequest
- type KeyRangeQuery
- type KeyspaceIdBatchQuery
- type KeyspaceIdQuery
- type Query
- type QueryResult
- type QueryResultList
- type QueryShard
- type RollbackRequest
- type RollbackResponse
- type Session
- type ShardSession
- type SplitQueryRequest
- type SplitQueryResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoundKeyspaceIdQueriesToProto ¶
func BoundKeyspaceIdQueriesToProto(bsq []BoundKeyspaceIdQuery) []*pb.BoundKeyspaceIdQuery
BoundKeyspaceIdQueriesToProto transforms a list of BoundKeyspaceIdQuery to proto3
func BoundShardQueriesToProto ¶
func BoundShardQueriesToProto(bsq []BoundShardQuery) []*pb.BoundShardQuery
BoundShardQueriesToProto transforms a list of BoundShardQuery to proto3
func EntityIdsToProto ¶
func EntityIdsToProto(l []EntityId) []*pb.ExecuteEntityIdsRequest_EntityId
EntityIdsToProto converts an array of EntityId to proto3
func SessionToProto ¶
SessionToProto transforms a Session into proto3
Types ¶
type BatchQueryShard ¶
type BatchQueryShard struct { CallerID *tproto.CallerID // only used by BSON Queries []BoundShardQuery TabletType topo.TabletType AsTransaction bool Session *Session }
BatchQueryShard represents a batch query request for the specified shards.
func (*BatchQueryShard) MarshalBson ¶
func (batchQueryShard *BatchQueryShard) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes BatchQueryShard.
func (*BatchQueryShard) UnmarshalBson ¶
func (batchQueryShard *BatchQueryShard) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into BatchQueryShard.
type BeginRequest ¶
BeginRequest is the BSON implementation of the proto3 query.BeginRequest
type BeginResponse ¶
type BeginResponse struct { // Err is named 'Err' instead of 'Error' (as the proto3 version is) to remain // consistent with other BSON structs. Err *mproto.RPCError Session *Session }
BeginResponse is the BSON implementation of the proto3 vtgate.BeginResponse
type BoundKeyspaceIdQuery ¶
type BoundKeyspaceIdQuery struct { Sql string BindVariables map[string]interface{} Keyspace string KeyspaceIds []key.KeyspaceId }
BoundKeyspaceIdQuery represents a single query request for the specified list of keyspace ids. This is used in a list for KeyspaceIdBatchQuery.
func ProtoToBoundKeyspaceIdQueries ¶
func ProtoToBoundKeyspaceIdQueries(bsq []*pb.BoundKeyspaceIdQuery) []BoundKeyspaceIdQuery
ProtoToBoundKeyspaceIdQueries transforms a list of BoundKeyspaceIdQuery from proto3
func (*BoundKeyspaceIdQuery) MarshalBson ¶
func (boundKeyspaceIdQuery *BoundKeyspaceIdQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes BoundKeyspaceIdQuery.
func (*BoundKeyspaceIdQuery) UnmarshalBson ¶
func (boundKeyspaceIdQuery *BoundKeyspaceIdQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into BoundKeyspaceIdQuery.
type BoundShardQuery ¶
type BoundShardQuery struct { Sql string BindVariables map[string]interface{} Keyspace string Shards []string }
BoundShardQuery represents a single query request for the specified list of shards. This is used in a list for BatchQueryShard.
func ProtoToBoundShardQueries ¶
func ProtoToBoundShardQueries(bsq []*pb.BoundShardQuery) []BoundShardQuery
ProtoToBoundShardQueries transforms a list of BoundShardQuery from proto3
func (*BoundShardQuery) MarshalBson ¶
func (boundShardQuery *BoundShardQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes BoundShardQuery.
func (*BoundShardQuery) UnmarshalBson ¶
func (boundShardQuery *BoundShardQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into BoundShardQuery.
type CommitRequest ¶
CommitRequest is the BSON implementation of the proto3 vtgate.CommitRequest
type CommitResponse ¶
type CommitResponse struct { // Err is named 'Err' instead of 'Error' (as the proto3 version is) to remain // consistent with other BSON structs. Err *mproto.RPCError }
CommitResponse is the BSON implementation of the proto3 vtgate.CommitResponse
type EntityId ¶
type EntityId struct { ExternalID interface{} KeyspaceID key.KeyspaceId }
EntityId represents a tuple of external_id and keyspace_id
func ProtoToEntityIds ¶
func ProtoToEntityIds(l []*pb.ExecuteEntityIdsRequest_EntityId) []EntityId
ProtoToEntityIds converts an array of EntityId from proto3
func (*EntityId) MarshalBson ¶
func (entityId *EntityId) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes EntityId.
type EntityIdsQuery ¶
type EntityIdsQuery struct { CallerID *tproto.CallerID // only used by BSON Sql string BindVariables map[string]interface{} Keyspace string EntityColumnName string EntityKeyspaceIDs []EntityId TabletType topo.TabletType Session *Session NotInTransaction bool }
EntityIdsQuery represents a query request for the specified KeyspaceId map.
func (*EntityIdsQuery) MarshalBson ¶
func (entityIdsQuery *EntityIdsQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes EntityIdsQuery.
func (*EntityIdsQuery) UnmarshalBson ¶
func (entityIdsQuery *EntityIdsQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into EntityIdsQuery.
type GetSrvKeyspaceRequest ¶
type GetSrvKeyspaceRequest struct {
Keyspace string
}
GetSrvKeyspaceRequest is the payload to GetSrvRequest
type KeyRangeQuery ¶
type KeyRangeQuery struct { CallerID *tproto.CallerID // only used by BSON Sql string BindVariables map[string]interface{} Keyspace string KeyRanges []key.KeyRange TabletType topo.TabletType Session *Session NotInTransaction bool }
KeyRangeQuery represents a query request for the specified list of keyranges.
func (*KeyRangeQuery) MarshalBson ¶
func (keyRangeQuery *KeyRangeQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes KeyRangeQuery.
func (*KeyRangeQuery) UnmarshalBson ¶
func (keyRangeQuery *KeyRangeQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into KeyRangeQuery.
type KeyspaceIdBatchQuery ¶
type KeyspaceIdBatchQuery struct { CallerID *tproto.CallerID // only used by BSON Queries []BoundKeyspaceIdQuery TabletType topo.TabletType AsTransaction bool Session *Session }
KeyspaceIdBatchQuery represents a batch query request for the specified keyspace IDs.
func (*KeyspaceIdBatchQuery) MarshalBson ¶
func (keyspaceIdBatchQuery *KeyspaceIdBatchQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes KeyspaceIdBatchQuery.
func (*KeyspaceIdBatchQuery) UnmarshalBson ¶
func (keyspaceIdBatchQuery *KeyspaceIdBatchQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into KeyspaceIdBatchQuery.
type KeyspaceIdQuery ¶
type KeyspaceIdQuery struct { CallerID *tproto.CallerID // only used by BSON Sql string BindVariables map[string]interface{} Keyspace string KeyspaceIds []key.KeyspaceId TabletType topo.TabletType Session *Session NotInTransaction bool }
KeyspaceIdQuery represents a query request for the specified list of keyspace IDs.
func (*KeyspaceIdQuery) MarshalBson ¶
func (keyspaceIdQuery *KeyspaceIdQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes KeyspaceIdQuery.
func (*KeyspaceIdQuery) UnmarshalBson ¶
func (keyspaceIdQuery *KeyspaceIdQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into KeyspaceIdQuery.
type Query ¶
type Query struct { CallerID *tproto.CallerID // only used by BSON Sql string BindVariables map[string]interface{} TabletType topo.TabletType Session *Session NotInTransaction bool }
Query represents a keyspace agnostic query request.
func (*Query) MarshalBson ¶
func (query *Query) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes Query.
type QueryResult ¶
type QueryResult struct { Result *mproto.QueryResult Session *Session // Error field is deprecated, as it only returns a string. New users should use the // Err field below, which contains a string and an error code. Error string Err *mproto.RPCError }
QueryResult is mproto.QueryResult+Session (for now).
func (*QueryResult) MarshalBson ¶
func (queryResult *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes QueryResult.
func (*QueryResult) UnmarshalBson ¶
func (queryResult *QueryResult) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into QueryResult.
type QueryResultList ¶
type QueryResultList struct { List []mproto.QueryResult Session *Session // Error field is deprecated, as it only returns a string. New users should use the // Err field below, which contains a string and an error code. Error string Err *mproto.RPCError }
QueryResultList is mproto.QueryResultList+Session
type QueryShard ¶
type QueryShard struct { CallerID *tproto.CallerID // only used by BSON Sql string BindVariables map[string]interface{} Keyspace string Shards []string TabletType topo.TabletType Session *Session NotInTransaction bool }
QueryShard represents a query request for the specified list of shards.
func (*QueryShard) MarshalBson ¶
func (queryShard *QueryShard) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes QueryShard.
func (*QueryShard) UnmarshalBson ¶
func (queryShard *QueryShard) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into QueryShard.
type RollbackRequest ¶
RollbackRequest is the BSON implementation of the proto3 vtgate.RollbackRequest
type RollbackResponse ¶
type RollbackResponse struct { // Err is named 'Err' instead of 'Error' (as the proto3 version is) to remain // consistent with other BSON structs. Err *mproto.RPCError }
RollbackResponse is the BSON implementation of the proto3 vtgate.RollbackResponse
type Session ¶
type Session struct { InTransaction bool ShardSessions []*ShardSession }
Session represents the session state. It keeps track of the shards on which transactions are in progress, along with the corresponding transaction ids.
func ProtoToSession ¶
ProtoToSession transforms a proto3 Session into native types
func (*Session) MarshalBson ¶
func (session *Session) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes Session.
type ShardSession ¶
type ShardSession struct { Keyspace string Shard string TabletType topo.TabletType TransactionId int64 }
ShardSession represents the session state for a shard.
func (*ShardSession) MarshalBson ¶
func (shardSession *ShardSession) MarshalBson(buf *bytes2.ChunkedWriter, key string)
MarshalBson bson-encodes ShardSession.
func (*ShardSession) String ¶
func (shardSession *ShardSession) String() string
func (*ShardSession) UnmarshalBson ¶
func (shardSession *ShardSession) UnmarshalBson(buf *bytes.Buffer, kind byte)
UnmarshalBson bson-decodes into ShardSession.
type SplitQueryRequest ¶
type SplitQueryRequest struct { CallerID *tproto.CallerID // only used by BSON Keyspace string Query tproto.BoundQuery SplitColumn string SplitCount int }
SplitQueryRequest is a request to split a query into multiple parts
type SplitQueryResult ¶
type SplitQueryResult struct { Splits []*pbg.SplitQueryResponse_Part Err *mproto.RPCError }
SplitQueryResult is the response from SplitQueryRequest
Source Files ¶
- batch_query_shard_bson.go
- bound_keyspace_id_query_bson.go
- bound_shard_query_bson.go
- bsonrpc.go
- entity_id_bson.go
- entity_ids_query_bson.go
- key_range_query_bson.go
- keyspace_id_batch_query_bson.go
- keyspace_id_query_bson.go
- proto3.go
- query_bson.go
- query_result_bson.go
- query_shard_bson.go
- session_bson.go
- shard_session_bson.go
- vtgate_proto.go