Exemple #1
0
// 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()
}
Exemple #2
0
func (session *Session) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeInt64(buf, "TransactionId", session.TransactionId)
	bson.EncodeInt64(buf, "SessionId", session.SessionId)

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #3
0
func (ql *QueryList) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

	EncodeQueriesBson(ql.Queries, "Queries", buf)
	bson.EncodeInt64(buf, "TransactionId", ql.TransactionId)
	bson.EncodeInt64(buf, "SessionId", ql.SessionId)

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #4
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)
	bson.EncodeInt64(buf, "Flags", field.Flags)

	lenWriter.Close()
}
Exemple #5
0
func (query *Query) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeString(buf, "Sql", query.Sql)
	EncodeBindVariablesBson(buf, "BindVariables", query.BindVariables)
	bson.EncodeInt64(buf, "TransactionId", query.TransactionId)
	bson.EncodeInt64(buf, "SessionId", query.SessionId)

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #6
0
func (qr *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

	EncodeFieldsBson(qr.Fields, "Fields", buf)
	bson.EncodeInt64(buf, "RowsAffected", int64(qr.RowsAffected))
	bson.EncodeInt64(buf, "InsertId", int64(qr.InsertId))
	EncodeRowsBson(qr.Rows, "Rows", buf)

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #7
0
func (ql *QueryList) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	EncodeQueriesBson(ql.Queries, "Queries", buf)
	bson.EncodeInt64(buf, "TransactionId", ql.TransactionId)
	bson.EncodeInt64(buf, "SessionId", ql.SessionId)

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #8
0
func (ste *StreamEvent) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)
	bson.EncodeString(buf, "Category", ste.Category)
	bson.EncodeString(buf, "TableName", ste.TableName)
	bson.EncodeStringArray(buf, "PKColNames", ste.PKColNames)
	MarshalPKValuesBson(buf, "PKValues", ste.PKValues)
	bson.EncodeString(buf, "Sql", ste.Sql)
	bson.EncodeInt64(buf, "Timestamp", ste.Timestamp)
	bson.EncodeInt64(buf, "GroupId", ste.GroupId)
	buf.WriteByte(0)
	lenWriter.RecordLen()
}
func (stmt *Statement) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)
	bson.EncodeInt64(buf, "Category", int64(stmt.Category))
	bson.EncodeBinary(buf, "Sql", stmt.Sql)
	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #10
0
func (blt *BinlogTransaction) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)
	MarshalStatementsBson(buf, "Statements", blt.Statements)
	bson.EncodeInt64(buf, "GroupId", blt.GroupId)
	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #11
0
func (blt *BinlogTransaction) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)
	MarshalStatementsBson(buf, "Statements", blt.Statements)
	bson.EncodeInt64(buf, "GroupId", blt.GroupId)
	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #12
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.EncodeInt64(buf, "Val", myType.Val)

	lenWriter.Close()
}
Exemple #13
0
// MarshalBson bson-encodes RPCError.
func (rPCError *RPCError) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeInt64(buf, "Code", rPCError.Code)
	bson.EncodeString(buf, "Message", rPCError.Message)

	lenWriter.Close()
}
Exemple #14
0
// 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 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)
	bson.EncodeInt64(buf, "GroupId", binlogTransaction.GroupId)

	lenWriter.Close()
}
Exemple #16
0
// 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)
	bson.EncodeInt64(buf, "GroupId", blpPosition.GroupId)

	lenWriter.Close()
}
Exemple #17
0
func (req *RequestBson) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeString(buf, "ServiceMethod", req.ServiceMethod)
	bson.EncodeInt64(buf, "Seq", int64(req.Seq))

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #18
0
// MarshalBson bson-encodes ZkStat.
func (zkStat *ZkStat) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
	bson.EncodeOptionalPrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeInt64(buf, "Czxid", zkStat.czxid)
	bson.EncodeInt64(buf, "Mzxid", zkStat.mzxid)
	bson.EncodeTime(buf, "CTime", zkStat.cTime)
	bson.EncodeTime(buf, "MTime", zkStat.mTime)
	bson.EncodeInt(buf, "Version", zkStat.version)
	bson.EncodeInt(buf, "CVersion", zkStat.cVersion)
	bson.EncodeInt(buf, "AVersion", zkStat.aVersion)
	bson.EncodeInt64(buf, "EphemeralOwner", zkStat.ephemeralOwner)
	bson.EncodeInt(buf, "DataLength", zkStat.dataLength)
	bson.EncodeInt(buf, "NumChildren", zkStat.numChildren)
	bson.EncodeInt64(buf, "Pzxid", zkStat.pzxid)

	lenWriter.Close()
}
Exemple #19
0
func (zkStat *ZkStat) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeInt64(buf, "Czxid", zkStat.czxid)
	bson.EncodeInt64(buf, "Mzxid", zkStat.mzxid)
	bson.EncodeTime(buf, "CTime", zkStat.cTime)
	bson.EncodeTime(buf, "MTime", zkStat.mTime)
	bson.EncodeInt32(buf, "Version", int32(zkStat.version))
	bson.EncodeInt32(buf, "CVersion", int32(zkStat.cVersion))
	bson.EncodeInt32(buf, "AVersion", int32(zkStat.aVersion))
	bson.EncodeInt64(buf, "EphemeralOwner", zkStat.ephemeralOwner)
	bson.EncodeInt32(buf, "DataLength", int32(zkStat.dataLength))
	bson.EncodeInt32(buf, "NumChildren", int32(zkStat.numChildren))
	bson.EncodeInt64(buf, "Pzxid", zkStat.pzxid)

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #20
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()
	}
	bson.EncodeInt64(buf, "SessionId", query.SessionId)
	bson.EncodeInt64(buf, "TransactionId", query.TransactionId)

	lenWriter.Close()
}
Exemple #21
0
func MarshalFieldBson(field Field, key string, buf *bytes2.ChunkedWriter) {
	bson.EncodePrefix(buf, bson.Object, key)
	lenWriter := bson.NewLenWriter(buf)

	bson.EncodeString(buf, "Name", field.Name)
	bson.EncodeInt64(buf, "Type", field.Type)

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #22
0
// MarshalBson marshals QueryResult into buf.
func (qr *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

	mproto.EncodeFieldsBson(qr.Fields, "Fields", buf)
	bson.EncodeInt64(buf, "RowsAffected", int64(qr.RowsAffected))
	bson.EncodeInt64(buf, "InsertId", int64(qr.InsertId))
	mproto.EncodeRowsBson(qr.Rows, "Rows", buf)

	if qr.Session != nil {
		bson.EncodePrefix(buf, bson.Object, "Session")
		qr.Session.MarshalBson(buf)
	}

	if qr.Error != "" {
		bson.EncodeString(buf, "Error", qr.Error)
	}

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #23
0
// MarshalBson marshals ShardSession into buf.
func (shardSession *ShardSession) MarshalBson(buf *bytes2.ChunkedWriter) {
	lenWriter := bson.NewLenWriter(buf)

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

	buf.WriteByte(0)
	lenWriter.RecordLen()
}
Exemple #24
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()
}
Exemple #25
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)
	bson.EncodeInt64(buf, "GroupId", streamEvent.GroupId)

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

	bson.EncodeInt64(buf, "SessionId", sessionInfo.SessionId)
	// *mproto.RPCError
	if sessionInfo.Err == nil {
		bson.EncodePrefix(buf, bson.Null, "Err")
	} else {
		(*sessionInfo.Err).MarshalBson(buf, "Err")
	}

	lenWriter.Close()
}
Exemple #27
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()
}
Exemple #28
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)
	// []mproto.Field
	{
		bson.EncodePrefix(buf, bson.Array, "PrimaryKeyFields")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v1 := range streamEvent.PrimaryKeyFields {
			_v1.MarshalBson(buf, bson.Itoa(_i))
		}
		lenWriter.Close()
	}
	// [][]sqltypes.Value
	{
		bson.EncodePrefix(buf, bson.Array, "PrimaryKeyValues")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v2 := range streamEvent.PrimaryKeyValues {
			// []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()
	}
	bson.EncodeString(buf, "Sql", streamEvent.Sql)
	bson.EncodeInt64(buf, "Timestamp", streamEvent.Timestamp)
	bson.EncodeString(buf, "TransactionID", streamEvent.TransactionID)

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

	// []string
	{
		bson.EncodePrefix(buf, bson.Array, "Slice")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v1 := range myType.Slice {
			bson.EncodeString(buf, bson.Itoa(_i), _v1)
		}
		lenWriter.Close()
	}
	// [][]byte
	{
		bson.EncodePrefix(buf, bson.Array, "SliceBytes")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v2 := range myType.SliceBytes {
			bson.EncodeBinary(buf, bson.Itoa(_i), _v2)
		}
		lenWriter.Close()
	}
	// []*string
	{
		bson.EncodePrefix(buf, bson.Array, "SlicePtr")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v3 := range myType.SlicePtr {
			// *string
			if _v3 == nil {
				bson.EncodePrefix(buf, bson.Null, bson.Itoa(_i))
			} else {
				bson.EncodeString(buf, bson.Itoa(_i), (*_v3))
			}
		}
		lenWriter.Close()
	}
	// [][]string
	{
		bson.EncodePrefix(buf, bson.Array, "SliceSlice")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v4 := range myType.SliceSlice {
			// []string
			{
				bson.EncodePrefix(buf, bson.Array, bson.Itoa(_i))
				lenWriter := bson.NewLenWriter(buf)
				for _i, _v5 := range _v4 {
					bson.EncodeString(buf, bson.Itoa(_i), _v5)
				}
				lenWriter.Close()
			}
		}
		lenWriter.Close()
	}
	// []map[string]int64
	{
		bson.EncodePrefix(buf, bson.Array, "SliceMap")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v6 := range myType.SliceMap {
			// map[string]int64
			{
				bson.EncodePrefix(buf, bson.Object, bson.Itoa(_i))
				lenWriter := bson.NewLenWriter(buf)
				for _k, _v7 := range _v6 {
					bson.EncodeInt64(buf, _k, _v7)
				}
				lenWriter.Close()
			}
		}
		lenWriter.Close()
	}
	// []Custom
	{
		bson.EncodePrefix(buf, bson.Array, "SliceCustom")
		lenWriter := bson.NewLenWriter(buf)
		for _i, _v8 := range myType.SliceCustom {
			_v8.MarshalBson(buf, bson.Itoa(_i))
		}
		lenWriter.Close()
	}

	lenWriter.Close()
}
Exemple #30
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()
}