// 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 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 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()
}
Example #4
0
// 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()
}
Example #5
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")
	}

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

	bson.EncodeString(buf, "Cell", getSrvKeyspaceArgs.Cell)
	bson.EncodeString(buf, "Keyspace", getSrvKeyspaceArgs.Keyspace)

	lenWriter.Close()
}
Example #7
0
func (resp *ResponseBson) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeString(buf, "ServiceMethod", resp.ServiceMethod)
	bson.EncodeUint64(buf, "Seq", resp.Seq)
	bson.EncodeString(buf, "Error", resp.Error)

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

	bson.EncodeString(buf, "Keyspace", shardSession.Keyspace)
	bson.EncodeString(buf, "Shard", shardSession.Shard)
	shardSession.TabletType.MarshalBson(buf, "TabletType")
	bson.EncodeInt64(buf, "TransactionId", shardSession.TransactionId)

	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()
}
Example #10
0
// 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 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()
}
Example #12
0
// 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))
}
Example #13
0
// 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))
}
Example #14
0
// 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()
}
Example #15
0
// 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()
}
Example #16
0
// MarshalBson bson-encodes GTIDField.
func (gf GTIDField) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)

	lenWriter := bson.NewLenWriter(buf)

	if gf.Value != nil {
		// The name of the bson field is the MySQL flavor.
		bson.EncodeString(buf, gf.Value.Flavor(), gf.Value.String())
	}

	lenWriter.Close()
}
Example #17
0
// MarshalBson bson-encodes ReplicationPosition.
func (rp ReplicationPosition) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)

	lenWriter := bson.NewLenWriter(buf)

	if rp.GTIDSet != nil {
		// The name of the bson field is the MySQL flavor.
		bson.EncodeString(buf, rp.GTIDSet.Flavor(), rp.GTIDSet.String())
	}

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

	bson.EncodeString(buf, "Path", zkNode.Path)
	bson.EncodeString(buf, "Data", zkNode.Data)
	zkNode.Stat.MarshalBson(buf, "Stat")
	// []string
	{
		bson.EncodePrefix(buf, bson.Array, "Children")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v1 := range zkNode.Children {
			bson.EncodeString(buf, bson.Itoa(_i), _v1)
		}
		lenWriter.Close()
	}
	bson.EncodeBool(buf, "Cached", zkNode.Cached)
	bson.EncodeBool(buf, "Stale", zkNode.Stale)

	lenWriter.Close()
}
Example #19
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()
}
// 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()
}
Example #21
0
// 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()
}
Example #22
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 #23
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 #24
0
// MarshalBson bson-encodes QueryResult.
func (queryResult *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	// *mproto.QueryResult
	if queryResult.Result == nil {
		bson.EncodePrefix(buf, bson.Null, "Result")
	} else {
		(*queryResult.Result).MarshalBson(buf, "Result")
	}
	// *Session
	if queryResult.Session == nil {
		bson.EncodePrefix(buf, bson.Null, "Session")
	} else {
		(*queryResult.Session).MarshalBson(buf, "Session")
	}
	bson.EncodeString(buf, "Error", queryResult.Error)

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

	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")
	}

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

	// map[string]string
	{
		bson.EncodePrefix(buf, bson.Object, "Map")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v1 := range myType.Map {
			bson.EncodeString(buf, _k, _v1)
		}
		lenWriter.Close()
	}
	// map[string][]byte
	{
		bson.EncodePrefix(buf, bson.Object, "MapBytes")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v2 := range myType.MapBytes {
			bson.EncodeBinary(buf, _k, _v2)
		}
		lenWriter.Close()
	}
	// map[string]*string
	{
		bson.EncodePrefix(buf, bson.Object, "MapPtr")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v3 := range myType.MapPtr {
			// *string
			if _v3 == nil {
				bson.EncodePrefix(buf, bson.Null, _k)
			} else {
				bson.EncodeString(buf, _k, (*_v3))
			}
		}
		lenWriter.Close()
	}
	// map[string][]string
	{
		bson.EncodePrefix(buf, bson.Object, "MapSlice")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v4 := range myType.MapSlice {
			// []string
			{
				bson.EncodePrefix(buf, bson.Array, _k)
				lenWriter := bson.NewLenWriter(buf)
				for _i, _v5 := range _v4 {
					bson.EncodeString(buf, bson.Itoa(_i), _v5)
				}
				lenWriter.Close()
			}
		}
		lenWriter.Close()
	}
	// map[string]map[string]int64
	{
		bson.EncodePrefix(buf, bson.Object, "MapMap")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v6 := range myType.MapMap {
			// map[string]int64
			{
				bson.EncodePrefix(buf, bson.Object, _k)
				lenWriter := bson.NewLenWriter(buf)
				for _k, _v7 := range _v6 {
					bson.EncodeInt64(buf, _k, _v7)
				}
				lenWriter.Close()
			}
		}
		lenWriter.Close()
	}
	// map[string]Custom
	{
		bson.EncodePrefix(buf, bson.Object, "MapCustom")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v8 := range myType.MapCustom {
			_v8.MarshalBson(buf, _k)
		}
		lenWriter.Close()
	}
	// map[string]*Custom
	{
		bson.EncodePrefix(buf, bson.Object, "MapCustomPtr")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v9 := range myType.MapCustomPtr {
			// *Custom
			if _v9 == nil {
				bson.EncodePrefix(buf, bson.Null, _k)
			} else {
				(*_v9).MarshalBson(buf, _k)
			}
		}
		lenWriter.Close()
	}
	// map[Custom]string
	{
		bson.EncodePrefix(buf, bson.Object, "CustomMap")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v10 := range myType.CustomMap {
			bson.EncodeString(buf, string(_k), _v10)
		}
		lenWriter.Close()
	}
	// map[pkg.Custom]string
	{
		bson.EncodePrefix(buf, bson.Object, "MapExternal")
		lenWriter := bson.NewLenWriter(buf)
		for _k, _v11 := range myType.MapExternal {
			bson.EncodeString(buf, string(_k), _v11)
		}
		lenWriter.Close()
	}

	lenWriter.Close()
}