本文整理汇总了Golang中github.com/youtube/vitess/go/bson.DecodeInt64函数的典型用法代码示例。如果您正苦于以下问题:Golang DecodeInt64函数的具体用法?Golang DecodeInt64怎么用?Golang DecodeInt64使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DecodeInt64函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: UnmarshalBson
func (ste *StreamEvent) UnmarshalBson(buf *bytes.Buffer) {
bson.Next(buf, 4)
kind := bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Category":
ste.Category = bson.DecodeString(buf, kind)
case "TableName":
ste.TableName = bson.DecodeString(buf, kind)
case "PKColNames":
ste.PKColNames = bson.DecodeStringArray(buf, kind)
case "PKValues":
ste.PKValues = UnmarshalPKValuesBson(buf, kind)
case "Sql":
ste.Sql = bson.DecodeString(buf, kind)
case "Timestamp":
ste.Timestamp = bson.DecodeInt64(buf, kind)
case "GroupId":
ste.GroupId = bson.DecodeInt64(buf, kind)
default:
panic(bson.NewBsonError("Unrecognized tag %s", key))
}
kind = bson.NextByte(buf)
}
}
开发者ID:rjammala,项目名称:vitess,代码行数:27,代码来源:stream_event.go
示例2: UnmarshalBson
func (zkStat *ZkStat) UnmarshalBson(buf *bytes.Buffer) {
bson.Next(buf, 4)
kind := bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Czxid":
zkStat.czxid = bson.DecodeInt64(buf, kind)
case "Mzxid":
zkStat.mzxid = bson.DecodeInt64(buf, kind)
case "CTime":
zkStat.cTime = bson.DecodeTime(buf, kind)
case "MTime":
zkStat.mTime = bson.DecodeTime(buf, kind)
case "Version":
zkStat.version = bson.DecodeInt(buf, kind)
case "CVersion":
zkStat.cVersion = bson.DecodeInt(buf, kind)
case "AVersion":
zkStat.aVersion = bson.DecodeInt(buf, kind)
case "EphemeralOwner":
zkStat.ephemeralOwner = bson.DecodeInt64(buf, kind)
case "DataLength":
zkStat.dataLength = bson.DecodeInt(buf, kind)
case "NumChildren":
zkStat.numChildren = bson.DecodeInt(buf, kind)
case "Pzxid":
zkStat.pzxid = bson.DecodeInt64(buf, kind)
default:
panic(bson.NewBsonError("Unrecognized tag %s for ZkStat", key))
}
kind = bson.NextByte(buf)
}
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:35,代码来源:zkocc_bson.go
示例3: UnmarshalBson
func (ste *StreamEvent) UnmarshalBson(buf *bytes.Buffer, kind byte) {
bson.VerifyObject(kind)
bson.Next(buf, 4)
kind = bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Category":
ste.Category = bson.DecodeString(buf, kind)
case "TableName":
ste.TableName = bson.DecodeString(buf, kind)
case "PKColNames":
ste.PKColNames = bson.DecodeStringArray(buf, kind)
case "PKValues":
ste.PKValues = UnmarshalPKValuesBson(buf, kind)
case "Sql":
ste.Sql = bson.DecodeString(buf, kind)
case "Timestamp":
ste.Timestamp = bson.DecodeInt64(buf, kind)
case "GroupId":
ste.GroupId = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
kind = bson.NextByte(buf)
}
}
开发者ID:rudyLi,项目名称:vitess,代码行数:28,代码来源:stream_event.go
示例4: UnmarshalBson
// UnmarshalBson bson-decodes into ShardSession.
func (shardSession *ShardSession) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for ShardSession", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Keyspace":
shardSession.Keyspace = bson.DecodeString(buf, kind)
case "Shard":
shardSession.Shard = bson.DecodeString(buf, kind)
case "TabletType":
shardSession.TabletType.UnmarshalBson(buf, kind)
case "TransactionId":
shardSession.TransactionId = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:richarwu,项目名称:vitess,代码行数:27,代码来源:shard_session_bson.go
示例5: UnmarshalPKRowBson
func UnmarshalPKRowBson(buf *bytes.Buffer, kind byte) []interface{} {
switch kind {
case bson.Array:
// valid
case bson.Null:
return nil
default:
panic(bson.NewBsonError("Unexpected data type %v for Query.Row", kind))
}
bson.Next(buf, 4)
row := make([]interface{}, 0, 8)
kind = bson.NextByte(buf)
for i := 0; kind != bson.EOO; i++ {
bson.ExpectIndex(buf, i)
var val interface{}
switch kind {
case bson.Binary, bson.String:
val = bson.DecodeString(buf, kind)
case bson.Long:
val = bson.DecodeInt64(buf, kind)
case bson.Ulong:
val = bson.DecodeUint64(buf, kind)
}
row = append(row, val)
kind = bson.NextByte(buf)
}
return row
}
开发者ID:rjammala,项目名称:vitess,代码行数:29,代码来源:stream_event.go
示例6: UnmarshalBson
// UnmarshalBson bson-decodes into BinlogTransaction.
func (binlogTransaction *BinlogTransaction) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for BinlogTransaction", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Statements":
// []Statement
if kind != bson.Null {
if kind != bson.Array {
panic(bson.NewBsonError("unexpected kind %v for binlogTransaction.Statements", kind))
}
bson.Next(buf, 4)
binlogTransaction.Statements = make([]Statement, 0, 8)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
bson.SkipIndex(buf)
var _v1 Statement
_v1.UnmarshalBson(buf, kind)
binlogTransaction.Statements = append(binlogTransaction.Statements, _v1)
}
}
case "GroupId":
binlogTransaction.GroupId = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:nosix-me,项目名称:vitess,代码行数:36,代码来源:binlog_transaction_bson.go
示例7: UnmarshalBson
// UnmarshalBson bson-decodes into SessionInfo.
func (sessionInfo *SessionInfo) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for SessionInfo", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "SessionId":
sessionInfo.SessionId = bson.DecodeInt64(buf, kind)
case "Err":
// *mproto.RPCError
if kind != bson.Null {
sessionInfo.Err = new(mproto.RPCError)
(*sessionInfo.Err).UnmarshalBson(buf, kind)
}
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:pranjal5215,项目名称:vitess,代码行数:27,代码来源:session_info_bson.go
示例8: UnmarshalBson
func (session *Session) UnmarshalBson(buf *bytes.Buffer) {
bson.Next(buf, 4)
kind := bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "TransactionId":
session.TransactionId = bson.DecodeInt64(buf, kind)
case "SessionId":
session.SessionId = bson.DecodeInt64(buf, kind)
default:
panic(bson.NewBsonError("Unrecognized tag %s", key))
}
kind = bson.NextByte(buf)
}
}
开发者ID:rjammala,项目名称:vitess,代码行数:17,代码来源:bson.go
示例9: UnmarshalBson
func (session *Session) UnmarshalBson(buf *bytes.Buffer, kind byte) {
bson.VerifyObject(kind)
bson.Next(buf, 4)
kind = bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "TransactionId":
session.TransactionId = bson.DecodeInt64(buf, kind)
case "SessionId":
session.SessionId = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
kind = bson.NextByte(buf)
}
}
开发者ID:rudyLi,项目名称:vitess,代码行数:18,代码来源:bson.go
示例10: UnmarshalBson
// UnmarshalBson bson-decodes into ZkStat.
func (zkStat *ZkStat) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for ZkStat", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Czxid":
zkStat.czxid = bson.DecodeInt64(buf, kind)
case "Mzxid":
zkStat.mzxid = bson.DecodeInt64(buf, kind)
case "CTime":
zkStat.cTime = bson.DecodeTime(buf, kind)
case "MTime":
zkStat.mTime = bson.DecodeTime(buf, kind)
case "Version":
zkStat.version = bson.DecodeInt(buf, kind)
case "CVersion":
zkStat.cVersion = bson.DecodeInt(buf, kind)
case "AVersion":
zkStat.aVersion = bson.DecodeInt(buf, kind)
case "EphemeralOwner":
zkStat.ephemeralOwner = bson.DecodeInt64(buf, kind)
case "DataLength":
zkStat.dataLength = bson.DecodeInt(buf, kind)
case "NumChildren":
zkStat.numChildren = bson.DecodeInt(buf, kind)
case "Pzxid":
zkStat.pzxid = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:chinna1986,项目名称:vitess,代码行数:41,代码来源:zkstat_bson.go
示例11: UnmarshalBson
// UnmarshalBson bson-decodes into QueryList.
func (queryList *QueryList) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for QueryList", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Queries":
// []BoundQuery
if kind != bson.Null {
if kind != bson.Array {
panic(bson.NewBsonError("unexpected kind %v for queryList.Queries", kind))
}
bson.Next(buf, 4)
queryList.Queries = make([]BoundQuery, 0, 8)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
bson.SkipIndex(buf)
var _v1 BoundQuery
_v1.UnmarshalBson(buf, kind)
queryList.Queries = append(queryList.Queries, _v1)
}
}
case "SessionId":
queryList.SessionId = bson.DecodeInt64(buf, kind)
case "AsTransaction":
queryList.AsTransaction = bson.DecodeBool(buf, kind)
case "TransactionId":
queryList.TransactionId = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:richarwu,项目名称:vitess,代码行数:40,代码来源:query_list_bson.go
示例12: UnmarshalBson
// UnmarshalBson bson-decodes into Query.
func (query *Query) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for Query", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Sql":
query.Sql = bson.DecodeString(buf, kind)
case "BindVariables":
// map[string]interface{}
if kind != bson.Null {
if kind != bson.Object {
panic(bson.NewBsonError("unexpected kind %v for query.BindVariables", kind))
}
bson.Next(buf, 4)
query.BindVariables = make(map[string]interface{})
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
_k := bson.ReadCString(buf)
var _v1 interface{}
_v1 = bson.DecodeInterface(buf, kind)
query.BindVariables[_k] = _v1
}
}
case "SessionId":
query.SessionId = bson.DecodeInt64(buf, kind)
case "TransactionId":
query.TransactionId = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:chinna1986,项目名称:vitess,代码行数:40,代码来源:query_bson.go
示例13: UnmarshalBson
// UnmarshalBson bson-decodes into Field.
func (field *Field) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for Field", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Name":
field.Name = bson.DecodeString(buf, kind)
case "Type":
field.Type = bson.DecodeInt64(buf, kind)
case "Flags":
field.Flags = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:richarwu,项目名称:vitess,代码行数:25,代码来源:field_bson.go
示例14: UnmarshalBson
func (zkStat *ZkStat) UnmarshalBson(buf *bytes.Buffer, kind byte) {
bson.VerifyObject(kind)
bson.Next(buf, 4)
kind = bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Czxid":
zkStat.czxid = bson.DecodeInt64(buf, kind)
case "Mzxid":
zkStat.mzxid = bson.DecodeInt64(buf, kind)
case "CTime":
zkStat.cTime = bson.DecodeTime(buf, kind)
case "MTime":
zkStat.mTime = bson.DecodeTime(buf, kind)
case "Version":
zkStat.version = bson.DecodeInt(buf, kind)
case "CVersion":
zkStat.cVersion = bson.DecodeInt(buf, kind)
case "AVersion":
zkStat.aVersion = bson.DecodeInt(buf, kind)
case "EphemeralOwner":
zkStat.ephemeralOwner = bson.DecodeInt64(buf, kind)
case "DataLength":
zkStat.dataLength = bson.DecodeInt(buf, kind)
case "NumChildren":
zkStat.numChildren = bson.DecodeInt(buf, kind)
case "Pzxid":
zkStat.pzxid = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
kind = bson.NextByte(buf)
}
}
开发者ID:rudyLi,项目名称:vitess,代码行数:36,代码来源:zkocc_bson.go
示例15: UnmarshalBson
func (stmt *Statement) UnmarshalBson(buf *bytes.Buffer) {
bson.Next(buf, 4)
kind := bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Category":
stmt.Category = int(bson.DecodeInt64(buf, kind))
case "Sql":
stmt.Sql = bson.DecodeBytes(buf, kind)
default:
panic(bson.NewBsonError("Unrecognized tag %s", key))
}
kind = bson.NextByte(buf)
}
}
开发者ID:rjammala,项目名称:vitess,代码行数:17,代码来源:binlog_transaction.go
示例16: UnmarshalFieldBson
func UnmarshalFieldBson(field *Field, buf *bytes.Buffer) {
bson.Next(buf, 4)
kind := bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Name":
field.Name = bson.DecodeString(buf, kind)
case "Type":
field.Type = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
kind = bson.NextByte(buf)
}
}
开发者ID:rudyLi,项目名称:vitess,代码行数:17,代码来源:bson.go
示例17: UnmarshalFieldBson
func UnmarshalFieldBson(field *Field, buf *bytes.Buffer) {
bson.Next(buf, 4)
kind := bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Name":
field.Name = bson.DecodeString(buf, kind)
case "Type":
field.Type = bson.DecodeInt64(buf, kind)
default:
panic(bson.NewBsonError("Unrecognized tag %s", key))
}
kind = bson.NextByte(buf)
}
}
开发者ID:rjammala,项目名称:vitess,代码行数:17,代码来源:bson.go
示例18: UnmarshalBson
func (stmt *Statement) UnmarshalBson(buf *bytes.Buffer, kind byte) {
bson.VerifyObject(kind)
bson.Next(buf, 4)
kind = bson.NextByte(buf)
for kind != bson.EOO {
key := bson.ReadCString(buf)
switch key {
case "Category":
stmt.Category = int(bson.DecodeInt64(buf, kind))
case "Sql":
stmt.Sql = bson.DecodeBinary(buf, kind)
default:
bson.Skip(buf, kind)
}
kind = bson.NextByte(buf)
}
}
开发者ID:rudyLi,项目名称:vitess,代码行数:18,代码来源:binlog_transaction.go
示例19: UnmarshalBson
// UnmarshalBson bson-decodes into MyType.
func (myType *MyType) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for MyType", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Float64":
myType.Float64 = bson.DecodeFloat64(buf, kind)
case "String":
myType.String = bson.DecodeString(buf, kind)
case "Bool":
myType.Bool = bson.DecodeBool(buf, kind)
case "Int64":
myType.Int64 = bson.DecodeInt64(buf, kind)
case "Int32":
myType.Int32 = bson.DecodeInt32(buf, kind)
case "Int":
myType.Int = bson.DecodeInt(buf, kind)
case "Uint64":
myType.Uint64 = bson.DecodeUint64(buf, kind)
case "Uint32":
myType.Uint32 = bson.DecodeUint32(buf, kind)
case "Uint":
myType.Uint = bson.DecodeUint(buf, kind)
case "Bytes":
myType.Bytes = bson.DecodeBinary(buf, kind)
case "Time":
myType.Time = bson.DecodeTime(buf, kind)
case "Interface":
myType.Interface = bson.DecodeInterface(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:hfeeki,项目名称:vitess,代码行数:43,代码来源:output_simple.go
示例20: UnmarshalBson
// UnmarshalBson bson-decodes into MyType.
func (myType *MyType) UnmarshalBson(buf *bytes.Buffer, kind byte) {
switch kind {
case bson.EOO, bson.Object:
// valid
case bson.Null:
return
default:
panic(bson.NewBsonError("unexpected kind %v for MyType", kind))
}
bson.Next(buf, 4)
for kind := bson.NextByte(buf); kind != bson.EOO; kind = bson.NextByte(buf) {
switch bson.ReadCString(buf) {
case "Val":
myType.Val = bson.DecodeInt64(buf, kind)
default:
bson.Skip(buf, kind)
}
}
}
开发者ID:hfeeki,项目名称:vitess,代码行数:21,代码来源:output_mixed.go
注:本文中的github.com/youtube/vitess/go/bson.DecodeInt64函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论