// MarshalBson bson-encodes QueryShard. func (queryShard *QueryShard) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Sql", queryShard.Sql) // map[string]interface{} { bson.EncodePrefix(buf, bson.Object, "BindVariables") lenWriter := bson.NewLenWriter(buf) for _k, _v1 := range queryShard.BindVariables { bson.EncodeInterface(buf, _k, _v1) } lenWriter.Close() } bson.EncodeString(buf, "Keyspace", queryShard.Keyspace) // []string { bson.EncodePrefix(buf, bson.Array, "Shards") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range queryShard.Shards { bson.EncodeString(buf, bson.Itoa(_i), _v2) } lenWriter.Close() } queryShard.TabletType.MarshalBson(buf, "TabletType") // *Session if queryShard.Session == nil { bson.EncodePrefix(buf, bson.Null, "Session") } else { (*queryShard.Session).MarshalBson(buf, "Session") } lenWriter.Close() }
// MarshalBson bson-encodes KeyRangeQuery. func (keyRangeQuery *KeyRangeQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Sql", keyRangeQuery.Sql) // map[string]interface{} { bson.EncodePrefix(buf, bson.Object, "BindVariables") lenWriter := bson.NewLenWriter(buf) for _k, _v1 := range keyRangeQuery.BindVariables { bson.EncodeInterface(buf, _k, _v1) } lenWriter.Close() } bson.EncodeString(buf, "Keyspace", keyRangeQuery.Keyspace) // []kproto.KeyRange { bson.EncodePrefix(buf, bson.Array, "KeyRanges") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range keyRangeQuery.KeyRanges { _v2.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } keyRangeQuery.TabletType.MarshalBson(buf, "TabletType") // *Session if keyRangeQuery.Session == nil { bson.EncodePrefix(buf, bson.Null, "Session") } else { (*keyRangeQuery.Session).MarshalBson(buf, "Session") } lenWriter.Close() }
// MarshalBson bson-encodes EntityIdsQuery. func (entityIdsQuery *EntityIdsQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Sql", entityIdsQuery.Sql) // map[string]interface{} { bson.EncodePrefix(buf, bson.Object, "BindVariables") lenWriter := bson.NewLenWriter(buf) for _k, _v1 := range entityIdsQuery.BindVariables { bson.EncodeInterface(buf, _k, _v1) } lenWriter.Close() } bson.EncodeString(buf, "Keyspace", entityIdsQuery.Keyspace) bson.EncodeString(buf, "EntityColumnName", entityIdsQuery.EntityColumnName) // []EntityId { bson.EncodePrefix(buf, bson.Array, "EntityKeyspaceIDs") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range entityIdsQuery.EntityKeyspaceIDs { _v2.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } entityIdsQuery.TabletType.MarshalBson(buf, "TabletType") // *Session if entityIdsQuery.Session == nil { bson.EncodePrefix(buf, bson.Null, "Session") } else { (*entityIdsQuery.Session).MarshalBson(buf, "Session") } lenWriter.Close() }
// MarshalBson bson-encodes BatchQueryShard. func (batchQueryShard *BatchQueryShard) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []tproto.BoundQuery { bson.EncodePrefix(buf, bson.Array, "Queries") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range batchQueryShard.Queries { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } bson.EncodeString(buf, "Keyspace", batchQueryShard.Keyspace) // []string { bson.EncodePrefix(buf, bson.Array, "Shards") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range batchQueryShard.Shards { bson.EncodeString(buf, bson.Itoa(_i), _v2) } lenWriter.Close() } batchQueryShard.TabletType.MarshalBson(buf, "TabletType") // *Session if batchQueryShard.Session == nil { bson.EncodePrefix(buf, bson.Null, "Session") } else { (*batchQueryShard.Session).MarshalBson(buf, "Session") } lenWriter.Close() }
// MarshalBson bson-encodes QueryResult. func (queryResult *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []Field { bson.EncodePrefix(buf, bson.Array, "Fields") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range queryResult.Fields { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } bson.EncodeUint64(buf, "RowsAffected", queryResult.RowsAffected) bson.EncodeUint64(buf, "InsertId", queryResult.InsertId) // [][]sqltypes.Value { bson.EncodePrefix(buf, bson.Array, "Rows") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range queryResult.Rows { // []sqltypes.Value { bson.EncodePrefix(buf, bson.Array, bson.Itoa(_i)) lenWriter := bson.NewLenWriter(buf) for _i, _v3 := range _v2 { _v3.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes SrvShard. func (srvShard *SrvShard) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Name", srvShard.Name) srvShard.KeyRange.MarshalBson(buf, "KeyRange") // []TabletType { bson.EncodePrefix(buf, bson.Array, "ServedTypes") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range srvShard.ServedTypes { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } bson.EncodeString(buf, "MasterCell", srvShard.MasterCell) // []TabletType { bson.EncodePrefix(buf, bson.Array, "TabletTypes") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range srvShard.TabletTypes { _v2.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes KeyspaceIdBatchQuery. func (keyspaceIdBatchQuery *KeyspaceIdBatchQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []tproto.BoundQuery { bson.EncodePrefix(buf, bson.Array, "Queries") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range keyspaceIdBatchQuery.Queries { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } bson.EncodeString(buf, "Keyspace", keyspaceIdBatchQuery.Keyspace) // []kproto.KeyspaceId { bson.EncodePrefix(buf, bson.Array, "KeyspaceIds") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range keyspaceIdBatchQuery.KeyspaceIds { _v2.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } keyspaceIdBatchQuery.TabletType.MarshalBson(buf, "TabletType") // *Session if keyspaceIdBatchQuery.Session == nil { bson.EncodePrefix(buf, bson.Null, "Session") } else { (*keyspaceIdBatchQuery.Session).MarshalBson(buf, "Session") } lenWriter.Close() }
// MarshalBson bson-encodes SrvKeyspace. func (srvKeyspace *SrvKeyspace) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // map[TabletType]*KeyspacePartition { bson.EncodePrefix(buf, bson.Object, "Partitions") lenWriter := bson.NewLenWriter(buf) for _k, _v1 := range srvKeyspace.Partitions { // *KeyspacePartition if _v1 == nil { bson.EncodePrefix(buf, bson.Null, string(_k)) } else { (*_v1).MarshalBson(buf, string(_k)) } } lenWriter.Close() } // []SrvShard { bson.EncodePrefix(buf, bson.Array, "Shards") lenWriter := bson.NewLenWriter(buf) for _i, _v2 := range srvKeyspace.Shards { _v2.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } // []TabletType { bson.EncodePrefix(buf, bson.Array, "TabletTypes") lenWriter := bson.NewLenWriter(buf) for _i, _v3 := range srvKeyspace.TabletTypes { _v3.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } bson.EncodeString(buf, "ShardingColumnName", srvKeyspace.ShardingColumnName) srvKeyspace.ShardingColumnType.MarshalBson(buf, "ShardingColumnType") // map[TabletType]string { bson.EncodePrefix(buf, bson.Object, "ServedFrom") lenWriter := bson.NewLenWriter(buf) for _k, _v4 := range srvKeyspace.ServedFrom { bson.EncodeString(buf, string(_k), _v4) } lenWriter.Close() } bson.EncodeInt32(buf, "SplitShardCount", srvKeyspace.SplitShardCount) lenWriter.Close() }
// MarshalBson bson-encodes ZkPathV. func (zkPathV *ZkPathV) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []string { bson.EncodePrefix(buf, bson.Array, "Paths") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range zkPathV.Paths { bson.EncodeString(buf, bson.Itoa(_i), _v1) } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes KeyspacePartition. func (keyspacePartition *KeyspacePartition) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []SrvShard { bson.EncodePrefix(buf, bson.Array, "Shards") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range keyspacePartition.Shards { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes BlpPositionList. func (blpPositionList *BlpPositionList) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []BlpPosition { bson.EncodePrefix(buf, bson.Array, "Entries") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range blpPositionList.Entries { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes SrvKeyspaceNames. func (srvKeyspaceNames *SrvKeyspaceNames) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []string { bson.EncodePrefix(buf, bson.Array, "Entries") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range srvKeyspaceNames.Entries { bson.EncodeString(buf, bson.Itoa(_i), _v1) } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes QueryResultList. func (queryResultList *QueryResultList) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []mproto.QueryResult { bson.EncodePrefix(buf, bson.Array, "List") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range queryResultList.List { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes GetSrvKeyspaceNamesArgs. func (getSrvKeyspaceNamesArgs *GetSrvKeyspaceNamesArgs) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Cell", getSrvKeyspaceNamesArgs.Cell) lenWriter.Close() }
// MarshalBson bson-encodes TabletType. func (tabletType TabletType) MarshalBson(buf *bytes2.ChunkedWriter, key string) { if key == "" { lenWriter := bson.NewLenWriter(buf) defer lenWriter.Close() key = bson.MAGICTAG } bson.EncodeString(buf, key, string(tabletType)) }
// MarshalBson bson-encodes MyType. func (myType MyType) MarshalBson(buf *bytes2.ChunkedWriter, key string) { if key == "" { lenWriter := bson.NewLenWriter(buf) defer lenWriter.Close() key = bson.MAGICTAG } bson.EncodeInt(buf, key, int(myType)) }
// MarshalBson bson-encodes BoundQuery. func (boundQuery *BoundQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Sql", boundQuery.Sql) // map[string]interface{} { bson.EncodePrefix(buf, bson.Object, "BindVariables") lenWriter := bson.NewLenWriter(buf) for _k, _v1 := range boundQuery.BindVariables { bson.EncodeInterface(buf, _k, _v1) } lenWriter.Close() } lenWriter.Close() }
// MarshalBson bson-encodes KeyspaceId. func (keyspaceId KeyspaceId) MarshalBson(buf *bytes2.ChunkedWriter, key string) { if key == "" { lenWriter := bson.NewLenWriter(buf) defer lenWriter.Close() key = bson.MAGICTAG } bson.EncodeString(buf, key, string(keyspaceId)) }
// MarshalBson bson-encodes ZkPath. func (zkPath *ZkPath) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Path", zkPath.Path) lenWriter.Close() }
// MarshalBson bson-encodes MyType. func (myType *MyType) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeInt64(buf, "Val", myType.Val) lenWriter.Close() }
// MarshalBson bson-encodes EntityId. func (entityId *EntityId) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeInterface(buf, "ExternalID", entityId.ExternalID) entityId.KeyspaceID.MarshalBson(buf, "KeyspaceID") lenWriter.Close() }
// MarshalBson bson-encodes KeyRange. func (keyRange *KeyRange) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) keyRange.Start.MarshalBson(buf, "Start") keyRange.End.MarshalBson(buf, "End") lenWriter.Close() }
// MarshalBson bson-encodes BinlogTransaction. func (binlogTransaction *BinlogTransaction) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []Statement { bson.EncodePrefix(buf, bson.Array, "Statements") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range binlogTransaction.Statements { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } bson.EncodeInt64(buf, "Timestamp", binlogTransaction.Timestamp) binlogTransaction.GTIDField.MarshalBson(buf, "GTIDField") lenWriter.Close() }
// MarshalBson bson-encodes Field. func (field *Field) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Name", field.Name) bson.EncodeInt64(buf, "Type", field.Type) lenWriter.Close() }
// MarshalBson bson-encodes BlpPosition. func (blpPosition *BlpPosition) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeUint32(buf, "Uid", blpPosition.Uid) blpPosition.Position.MarshalBson(buf, "Position") lenWriter.Close() }
// MarshalBson bson-encodes Session. func (session *Session) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeInt64(buf, "SessionId", session.SessionId) bson.EncodeInt64(buf, "TransactionId", session.TransactionId) lenWriter.Close() }
func (req *RequestBson) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "ServiceMethod", req.ServiceMethod) bson.EncodeUint64(buf, "Seq", req.Seq) lenWriter.Close() }
// MarshalBson bson-encodes QueryList. func (queryList *QueryList) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) // []BoundQuery { bson.EncodePrefix(buf, bson.Array, "Queries") lenWriter := bson.NewLenWriter(buf) for _i, _v1 := range queryList.Queries { _v1.MarshalBson(buf, bson.Itoa(_i)) } lenWriter.Close() } bson.EncodeInt64(buf, "SessionId", queryList.SessionId) bson.EncodeInt64(buf, "TransactionId", queryList.TransactionId) lenWriter.Close() }
// MarshalBson bson-encodes Charset. func (charset *Charset) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeInt(buf, "Client", charset.Client) bson.EncodeInt(buf, "Conn", charset.Conn) bson.EncodeInt(buf, "Server", charset.Server) lenWriter.Close() }
// MarshalBson bson-encodes GetEndPointsArgs. func (getEndPointsArgs *GetEndPointsArgs) MarshalBson(buf *bytes2.ChunkedWriter, key string) { bson.EncodeOptionalPrefix(buf, bson.Object, key) lenWriter := bson.NewLenWriter(buf) bson.EncodeString(buf, "Cell", getEndPointsArgs.Cell) bson.EncodeString(buf, "Keyspace", getEndPointsArgs.Keyspace) bson.EncodeString(buf, "Shard", getEndPointsArgs.Shard) getEndPointsArgs.TabletType.MarshalBson(buf, "TabletType") lenWriter.Close() }