當前位置: 首頁>>代碼示例>>Golang>>正文


Golang bson.EncodeInt64函數代碼示例

本文整理匯總了Golang中github.com/youtube/vitess/go/bson.EncodeInt64函數的典型用法代碼示例。如果您正苦於以下問題:Golang EncodeInt64函數的具體用法?Golang EncodeInt64怎麽用?Golang EncodeInt64使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了EncodeInt64函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: MarshalBson

// 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()
}
開發者ID:chinna1986,項目名稱:vitess,代碼行數:10,代碼來源:session_bson.go

示例2: MarshalBson

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()
}
開發者ID:rjammala,項目名稱:vitess,代碼行數:9,代碼來源:bson.go

示例3: MarshalBson

// 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()
}
開發者ID:richarwu,項目名稱:vitess,代碼行數:11,代碼來源:field_bson.go

示例4: MarshalBson

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()
}
開發者ID:rjammala,項目名稱:vitess,代碼行數:11,代碼來源:bson.go

示例5: MarshalBson

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()
}
開發者ID:rudyLi,項目名稱:vitess,代碼行數:11,代碼來源:bson.go

示例6: MarshalBson

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()
}
開發者ID:rjammala,項目名稱:vitess,代碼行數:12,代碼來源:stream_event.go

示例7: MarshalBson

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()
}
開發者ID:rjammala,項目名稱:vitess,代碼行數:7,代碼來源:binlog_transaction.go

示例8: MarshalBson

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()
}
開發者ID:rudyLi,項目名稱:vitess,代碼行數:8,代碼來源:binlog_transaction.go

示例9: MarshalBson

// 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()
}
開發者ID:hfeeki,項目名稱:vitess,代碼行數:9,代碼來源:output_mixed.go

示例10: MarshalBson

// 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()
}
開發者ID:littleyang,項目名稱:vitess,代碼行數:10,代碼來源:rpcerror_bson.go

示例11: MarshalBson

// 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()
}
開發者ID:chinna1986,項目名稱:vitess,代碼行數:19,代碼來源:query_list_bson.go

示例12: MarshalBson

// 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()
}
開發者ID:kingpro,項目名稱:vitess,代碼行數:19,代碼來源:binlog_transaction_bson.go

示例13: MarshalBson

// 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()
}
開發者ID:kingpro,項目名稱:vitess,代碼行數:10,代碼來源:blp_position_bson.go

示例14: MarshalBson

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()
}
開發者ID:rjammala,項目名稱:vitess,代碼行數:9,代碼來源:custom_codecs.go

示例15: MarshalBson

// 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()
}
開發者ID:chinna1986,項目名稱:vitess,代碼行數:19,代碼來源:zkstat_bson.go


注:本文中的github.com/youtube/vitess/go/bson.EncodeInt64函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。