• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang bson.EncodeInt64函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/youtube/vitess/go/bson.EncodeInt64函数的典型用法代码示例。如果您正苦于以下问题:Golang EncodeInt64函数的具体用法?Golang EncodeInt64怎么用?Golang EncodeInt64使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了EncodeInt64函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: MarshalBson

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()
}
开发者ID:rjammala,项目名称:vitess,代码行数:18,代码来源:zkocc_bson.go


示例17: MarshalBson

// 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()
}
开发者ID:chinna1986,项目名称:vitess,代码行数:20,代码来源:query_bson.go


示例18: MarshalFieldBson

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()
}
开发者ID:rudyLi,项目名称:vitess,代码行数:10,代码来源:bson.go


示例19: MarshalBson

// 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()
}
开发者ID:rjammala,项目名称:vitess,代码行数:21,代码来源:vtgate_proto.go


示例20: MarshalBson

// 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()
}
开发者ID:richarwu,项目名称:vitess,代码行数:12,代码来源:shard_session_bson.go



注:本文中的github.com/youtube/vitess/go/bson.EncodeInt64函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang bson.EncodeOptionalPrefix函数代码示例发布时间:2022-05-28
下一篇:
Golang bson.EncodeBool函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap