本文整理汇总了Golang中github.com/youtube/vitess/go/bson.EncodeUint64函数的典型用法代码示例。如果您正苦于以下问题:Golang EncodeUint64函数的具体用法?Golang EncodeUint64怎么用?Golang EncodeUint64使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EncodeUint64函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: MarshalBson
// MarshalBson bson-encodes QueryResult.
func (queryResult *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
bson.EncodeOptionalPrefix(buf, bson.Object, key)
lenWriter := bson.NewLenWriter(buf)
// []Field
{
bson.EncodePrefix(buf, bson.Array, "Fields")
lenWriter := bson.NewLenWriter(buf)
for _i, _v1 := range queryResult.Fields {
_v1.MarshalBson(buf, bson.Itoa(_i))
}
lenWriter.Close()
}
bson.EncodeUint64(buf, "RowsAffected", queryResult.RowsAffected)
bson.EncodeUint64(buf, "InsertId", queryResult.InsertId)
// [][]sqltypes.Value
{
bson.EncodePrefix(buf, bson.Array, "Rows")
lenWriter := bson.NewLenWriter(buf)
for _i, _v2 := range queryResult.Rows {
// []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()
}
lenWriter.Close()
}
开发者ID:chinna1986,项目名称:vitess,代码行数:36,代码来源:query_result_bson.go
示例2: MarshalBson
func (qr *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
bson.EncodeOptionalPrefix(buf, bson.Object, key)
lenWriter := bson.NewLenWriter(buf)
EncodeFieldsBson(qr.Fields, "Fields", buf)
bson.EncodeUint64(buf, "RowsAffected", qr.RowsAffected)
bson.EncodeUint64(buf, "InsertId", qr.InsertId)
EncodeRowsBson(qr.Rows, "Rows", buf)
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:rudyLi,项目名称:vitess,代码行数:12,代码来源:bson.go
示例3: MarshalBson
func (session *Session) MarshalBson(buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Long, "TransactionId")
bson.EncodeUint64(buf, uint64(session.TransactionId))
bson.EncodePrefix(buf, bson.Long, "ConnectionId")
bson.EncodeUint64(buf, uint64(session.ConnectionId))
bson.EncodePrefix(buf, bson.Long, "SessionId")
bson.EncodeUint64(buf, uint64(session.SessionId))
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:15,代码来源:bson.go
示例4: MarshalBson
func (pos *BinlogPosition) MarshalBson(buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Object, "Position")
pos.Position.MarshalBson(buf)
bson.EncodePrefix(buf, bson.Long, "Timestamp")
bson.EncodeUint64(buf, uint64(pos.Timestamp))
bson.EncodePrefix(buf, bson.Ulong, "Xid")
bson.EncodeUint64(buf, pos.Xid)
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:15,代码来源:binlog.go
示例5: MarshalBson
// MarshalBson bson-encodes QueryResult.
func (queryResult *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
bson.EncodeOptionalPrefix(buf, bson.Object, key)
lenWriter := bson.NewLenWriter(buf)
// []*query.Field
{
bson.EncodePrefix(buf, bson.Array, "Fields")
lenWriter := bson.NewLenWriter(buf)
var f BSONField
for _i, _v1 := range queryResult.Fields {
// *query.Field
// This part was manually changed.
f.Name = _v1.Name
f.Type, f.Flags = sqltypes.TypeToMySQL(_v1.Type)
bson.EncodeOptionalPrefix(buf, bson.Object, bson.Itoa(_i))
bson.MarshalToBuffer(buf, &f)
}
lenWriter.Close()
}
bson.EncodeUint64(buf, "RowsAffected", queryResult.RowsAffected)
bson.EncodeUint64(buf, "InsertId", queryResult.InsertId)
// [][]sqltypes.Value
{
bson.EncodePrefix(buf, bson.Array, "Rows")
lenWriter := bson.NewLenWriter(buf)
for _i, _v2 := range queryResult.Rows {
// []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()
}
// *RPCError
if queryResult.Err == nil {
bson.EncodePrefix(buf, bson.Null, "Err")
} else {
(*queryResult.Err).MarshalBson(buf, "Err")
}
lenWriter.Close()
}
开发者ID:tjyang,项目名称:vitess,代码行数:48,代码来源:query_result_bson.go
示例6: encodeReplCoordinates
func (pos *BinlogPosition) encodeReplCoordinates(buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Binary, "RelayFilename")
bson.EncodeString(buf, pos.Position.RelayFilename)
bson.EncodePrefix(buf, bson.Ulong, "RelayPosition")
bson.EncodeUint64(buf, pos.Position.RelayPosition)
bson.EncodePrefix(buf, bson.Binary, "MasterFilename")
bson.EncodeString(buf, pos.Position.MasterFilename)
bson.EncodePrefix(buf, bson.Ulong, "MasterPosition")
bson.EncodeUint64(buf, pos.Position.MasterPosition)
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:shrutip,项目名称:vitess,代码行数:17,代码来源:binlog_parser.go
示例7: MarshalBson
// MarshalBson marshals request to the given writer with optional prefix
func (req *RequestBson) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
bson.EncodeOptionalPrefix(buf, bson.Object, key)
lenWriter := bson.NewLenWriter(buf)
bson.EncodeString(buf, "ServiceMethod", req.ServiceMethod)
bson.EncodeUint64(buf, "Seq", req.Seq)
lenWriter.Close()
}
开发者ID:littleyang,项目名称:vitess,代码行数:10,代码来源:custom_codecs.go
示例8: MarshalBson
func (qr *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Array, "Fields")
encodeFieldsBson(qr.Fields, buf)
bson.EncodePrefix(buf, bson.Long, "RowsAffected")
bson.EncodeUint64(buf, uint64(qr.RowsAffected))
bson.EncodePrefix(buf, bson.Long, "InsertId")
bson.EncodeUint64(buf, uint64(qr.InsertId))
bson.EncodePrefix(buf, bson.Array, "Rows")
encodeRowsBson(qr.Rows, buf)
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:18,代码来源:bson.go
示例9: MarshalBson
// MarshalBson bson-encodes QueryResult.
func (queryResult *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
bson.EncodeOptionalPrefix(buf, bson.Object, key)
lenWriter := bson.NewLenWriter(buf)
// []mproto.Field
{
bson.EncodePrefix(buf, bson.Array, "Fields")
lenWriter := bson.NewLenWriter(buf)
for _i, _v1 := range queryResult.Fields {
_v1.MarshalBson(buf, bson.Itoa(_i))
}
lenWriter.Close()
}
bson.EncodeUint64(buf, "RowsAffected", queryResult.RowsAffected)
bson.EncodeUint64(buf, "InsertId", queryResult.InsertId)
// [][]sqltypes.Value
{
bson.EncodePrefix(buf, bson.Array, "Rows")
lenWriter := bson.NewLenWriter(buf)
for _i, _v2 := range queryResult.Rows {
// []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()
}
// *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()
}
开发者ID:kingpro,项目名称:vitess,代码行数:43,代码来源:query_result_bson.go
示例10: MarshalBson
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)
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:rudyLi,项目名称:vitess,代码行数:11,代码来源:custom_codecs.go
示例11: MarshalBson
// MarshalBson marshals QueryResult into buf.
func (qr *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string) {
bson.EncodeOptionalPrefix(buf, bson.Object, key)
lenWriter := bson.NewLenWriter(buf)
mproto.EncodeFieldsBson(qr.Fields, "Fields", buf)
bson.EncodeUint64(buf, "RowsAffected", qr.RowsAffected)
bson.EncodeUint64(buf, "InsertId", qr.InsertId)
mproto.EncodeRowsBson(qr.Rows, "Rows", buf)
if qr.Session != nil {
qr.Session.MarshalBson(buf, "Session")
}
if qr.Error != "" {
bson.EncodeString(buf, "Error", qr.Error)
}
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:rudyLi,项目名称:vitess,代码行数:21,代码来源:vtgate_proto.go
示例12: MarshalFieldBson
func MarshalFieldBson(field Field, buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Binary, "Name")
bson.EncodeString(buf, field.Name)
bson.EncodePrefix(buf, bson.Long, "Type")
bson.EncodeUint64(buf, uint64(field.Type))
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:12,代码来源:bson.go
示例13: MarshalBson
func (req *RequestBson) MarshalBson(buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Binary, "ServiceMethod")
bson.EncodeString(buf, req.ServiceMethod)
bson.EncodePrefix(buf, bson.Long, "Seq")
bson.EncodeUint64(buf, uint64(req.Seq))
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:12,代码来源:custom_codecs.go
示例14: MarshalBson
func (zkStat *ZkStat) MarshalBson(buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Long, "Czxid")
bson.EncodeUint64(buf, uint64(zkStat.czxid))
bson.EncodePrefix(buf, bson.Long, "Mzxid")
bson.EncodeUint64(buf, uint64(zkStat.mzxid))
bson.EncodePrefix(buf, bson.Datetime, "CTime")
bson.EncodeTime(buf, zkStat.cTime)
bson.EncodePrefix(buf, bson.Datetime, "MTime")
bson.EncodeTime(buf, zkStat.mTime)
bson.EncodePrefix(buf, bson.Int, "Version")
bson.EncodeUint32(buf, uint32(zkStat.version))
bson.EncodePrefix(buf, bson.Int, "CVersion")
bson.EncodeUint32(buf, uint32(zkStat.cVersion))
bson.EncodePrefix(buf, bson.Int, "AVersion")
bson.EncodeUint32(buf, uint32(zkStat.aVersion))
bson.EncodePrefix(buf, bson.Long, "EphemeralOwner")
bson.EncodeUint64(buf, uint64(zkStat.ephemeralOwner))
bson.EncodePrefix(buf, bson.Int, "DataLength")
bson.EncodeUint32(buf, uint32(zkStat.dataLength))
bson.EncodePrefix(buf, bson.Int, "NumChildren")
bson.EncodeUint32(buf, uint32(zkStat.numChildren))
bson.EncodePrefix(buf, bson.Long, "Pzxid")
bson.EncodeUint64(buf, uint64(zkStat.pzxid))
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:39,代码来源:zkocc_bson.go
示例15: MarshalBson
func (bqs *BatchQueryShard) MarshalBson(buf *bytes2.ChunkedWriter) {
lenWriter := bson.NewLenWriter(buf)
bson.EncodePrefix(buf, bson.Array, "Queries")
encodeQueriesBson(bqs.Queries, buf)
bson.EncodePrefix(buf, bson.Long, "SessionId")
bson.EncodeUint64(buf, uint64(bqs.SessionId))
bson.EncodePrefix(buf, bson.Binary, "Keyspace")
bson.EncodeString(buf, bqs.Keyspace)
bson.EncodeStringArray(buf, "Shards", bqs.Shards)
buf.WriteByte(0)
lenWriter.RecordLen()
}
开发者ID:ZhuoRoger,项目名称:vitess,代码行数:17,代码来源:vtgate_proto.go
示例16: 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.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()
}
开发者ID:hfeeki,项目名称:vitess,代码行数:20,代码来源:output_simple.go
注:本文中的github.com/youtube/vitess/go/bson.EncodeUint64函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论