// MarshalBson bson-encodes KeyspaceIdQuery.
func (keyspaceIdQuery *KeyspaceIdQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeString(buf, "Sql", keyspaceIdQuery.Sql)
	// map[string]interface{}
	{
		bson.EncodePrefix(buf, bson.Object, "BindVariables")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v1 := range keyspaceIdQuery.BindVariables {
			bson.EncodeInterface(buf, _k, _v1)
		}
		lenWriter.Close()
	}
	bson.EncodeString(buf, "Keyspace", keyspaceIdQuery.Keyspace)
	// []kproto.KeyspaceId
	{
		bson.EncodePrefix(buf, bson.Array, "KeyspaceIds")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v2 := range keyspaceIdQuery.KeyspaceIds {
			_v2.MarshalBson(buf, bson.Itoa(_i))
		}
		lenWriter.Close()
	}
	keyspaceIdQuery.TabletType.MarshalBson(buf, "TabletType")
	// *Session
	if keyspaceIdQuery.Session == nil {
		bson.EncodePrefix(buf, bson.Null, "Session")
	} else {
		(*keyspaceIdQuery.Session).MarshalBson(buf, "Session")
	}

	lenWriter.Close()
}
// MarshalBson bson-encodes BoundShardQuery.
func (boundShardQuery *BoundShardQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeString(buf, "Sql", boundShardQuery.Sql)
	// map[string]interface{}
	{
		bson.EncodePrefix(buf, bson.Object, "BindVariables")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v1 := range boundShardQuery.BindVariables {
			bson.EncodeInterface(buf, _k, _v1)
		}
		lenWriter.Close()
	}
	bson.EncodeString(buf, "Keyspace", boundShardQuery.Keyspace)
	// []string
	{
		bson.EncodePrefix(buf, bson.Array, "Shards")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v2 := range boundShardQuery.Shards {
			bson.EncodeString(buf, bson.Itoa(_i), _v2)
		}
		lenWriter.Close()
	}

	lenWriter.Close()
}
Example #3
0
// 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")
	}
	bson.EncodeBool(buf, "NotInTransaction", queryShard.NotInTransaction)

	lenWriter.Close()
}
Example #4
0
// 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)
	// map[string]kproto.KeyspaceId
	{
		bson.EncodePrefix(buf, bson.Object, "EntityKeyspaceIdMap")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v2 := range entityIdsQuery.EntityKeyspaceIdMap {
			_v2.MarshalBson(buf, _k)
		}
		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()
}
Example #5
0
// MarshalBson bson-encodes Query.
func (query *Query) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	// *tproto.CallerID
	if query.CallerID == nil {
		bson.EncodePrefix(buf, bson.Null, "CallerID")
	} else {
		(*query.CallerID).MarshalBson(buf, "CallerID")
	}
	bson.EncodeString(buf, "Sql", query.Sql)
	// map[string]interface{}
	{
		bson.EncodePrefix(buf, bson.Object, "BindVariables")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v1 := range query.BindVariables {
			bson.EncodeInterface(buf, _k, _v1)
		}
		lenWriter.Close()
	}
	query.TabletType.MarshalBson(buf, "TabletType")
	// *Session
	if query.Session == nil {
		bson.EncodePrefix(buf, bson.Null, "Session")
	} else {
		(*query.Session).MarshalBson(buf, "Session")
	}
	bson.EncodeBool(buf, "NotInTransaction", query.NotInTransaction)

	lenWriter.Close()
}
Example #6
0
// 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()
}
Example #7
0
// 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()
}
Example #8
0
// MarshalBson bson-encodes MyType.
func (myType *MyType) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeFloat64(buf, "Float64", myType.Float64)
	bson.EncodeString(buf, "String", myType.String)
	bson.EncodeBool(buf, "Bool", myType.Bool)
	bson.EncodeInt64(buf, "Int64", myType.Int64)
	bson.EncodeInt32(buf, "Int32", myType.Int32)
	bson.EncodeInt(buf, "Int", myType.Int)
	bson.EncodeUint64(buf, "Uint64", myType.Uint64)
	bson.EncodeUint32(buf, "Uint32", myType.Uint32)
	bson.EncodeUint(buf, "Uint", myType.Uint)
	bson.EncodeBinary(buf, "Bytes", myType.Bytes)
	bson.EncodeTime(buf, "Time", myType.Time)
	bson.EncodeInterface(buf, "Interface", myType.Interface)

	lenWriter.Close()
}
Example #9
0
// MarshalBson bson-encodes EntityIdsQuery.
func (entityIdsQuery *EntityIdsQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	// *tproto.CallerID
	if entityIdsQuery.CallerID == nil {
		bson.EncodePrefix(buf, bson.Null, "CallerID")
	} else {
		(*entityIdsQuery.CallerID).MarshalBson(buf, "CallerID")
	}
	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")
	}
	bson.EncodeBool(buf, "NotInTransaction", entityIdsQuery.NotInTransaction)

	lenWriter.Close()
}
Example #10
0
// MarshalBson bson-encodes StreamEvent.
func (streamEvent *StreamEvent) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeString(buf, "Category", streamEvent.Category)
	bson.EncodeString(buf, "TableName", streamEvent.TableName)
	// []string
	{
		bson.EncodePrefix(buf, bson.Array, "PKColNames")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v1 := range streamEvent.PKColNames {
			bson.EncodeString(buf, bson.Itoa(_i), _v1)
		}
		lenWriter.Close()
	}
	// [][]interface{}
	{
		bson.EncodePrefix(buf, bson.Array, "PKValues")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v2 := range streamEvent.PKValues {
			// []interface{}
			{
				bson.EncodePrefix(buf, bson.Array, bson.Itoa(_i))
				lenWriter := bson.NewLenWriter(buf)
				for _i, _v3 := range _v2 {
					bson.EncodeInterface(buf, bson.Itoa(_i), _v3)
				}
				lenWriter.Close()
			}
		}
		lenWriter.Close()
	}
	bson.EncodeString(buf, "Sql", streamEvent.Sql)
	bson.EncodeInt64(buf, "Timestamp", streamEvent.Timestamp)
	streamEvent.GTIDField.MarshalBson(buf, "GTIDField")

	lenWriter.Close()
}