本文整理汇总了Golang中github.com/youtube/vitess/go/bson.DecodeInt64函数的典型用法代码示例。如果您正苦于以下问题:Golang DecodeInt64函数的具体用法?Golang DecodeInt64怎么用?Golang DecodeInt64使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DecodeInt64函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
}
}
示例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)
}
}
示例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)
}
}
示例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)
}
}
}
示例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
}
示例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)
}
}
}
示例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)
}
}
}
示例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)
}
}
示例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)
}
}
示例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)
}
}
}
示例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)
}
}
}
示例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)
}
}
}
示例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)
}
}
}
示例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)
}
}
示例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)
}
}