本文整理汇总了Golang中github.com/tamtam-im/teleport/lib/go/tl.Decoder.ReadLong方法的典型用法代码示例。如果您正苦于以下问题:Golang Decoder.ReadLong方法的具体用法?Golang Decoder.ReadLong怎么用?Golang Decoder.ReadLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/tamtam-im/teleport/lib/go/tl.Decoder
的用法示例。
在下文中一共展示了Decoder.ReadLong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Read
func (t *RpcResult) Read(decoder tl.Decoder, waitress tl.Waitress, session uuid.UUID) (err error) {
t.ReqMsgId, err = decoder.ReadLong()
if err != nil {
return
}
var res_err, err_err error
// try to get bare constructor from waitress
// track to res_err
if cons_id, _, _, res_err := waitress.GetResult(session, t.ReqMsgId); res_err == nil {
result_box := &ObjectBox{}
if res_err = result_box.Bind(cons_id); res_err == nil {
t.Result, res_err = result_box.Bare()
}
}
// Check for error
if peek_cons_id, err_err := decoder.PeekType(); err_err == nil && peek_cons_id == TL_ID_RPC_ERROR {
// got err - read it and return
err_box := (&RpcError{}).Box()
if err_err = err_box.Read(decoder, waitress, session); err_err == nil {
if err_bare, err_err := err_box.Bare(); err_err == nil {
t.RpcError = err_bare.(*RpcError)
}
}
}
if res_err == nil && err_err == nil && t.RpcError == nil {
res_err = t.Result.Read(decoder, waitress, session)
}
// return one of res_err or err_err
if res_err != nil {
err = res_err
} else if err_err != nil {
err = err_err
}
return
}
示例2: Read
func (t *Long) Read(decoder tl.Decoder, waitress tl.Waitress, bind_uuid uuid.UUID) (err error) {
t.value, err = decoder.ReadLong()
return
}