本文整理汇总了Golang中github.com/tamtam-im/teleport/lib/go/tl.Encoder类的典型用法代码示例。如果您正苦于以下问题:Golang Encoder类的具体用法?Golang Encoder怎么用?Golang Encoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Encoder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Write
func (t *RpcError) Write(proto tl.Encoder) (err error) {
err = proto.WriteInt(t.ErrorCode)
if err != nil {
return
}
err = proto.WriteString(t.ErrorMessage)
return
}
示例2: Write
func (t *RpcResult) Write(encoder tl.Encoder) (err error) {
if err = encoder.WriteLong(t.ReqMsgId); err != nil {
return
}
if t.RpcError != nil {
err = (t.RpcError.(*RpcError)).Box().Write(encoder)
} else {
err = t.Result.Write(encoder)
}
return
}
示例3: Write
func (b *ObjectBox) Write(proto tl.Encoder) (err error) {
bare, err := b.Bare()
if err != nil {
return
}
err = proto.WriteTypeBegin(bare.GetID())
if err != nil {
return
}
err = bare.Write(proto)
return
}
示例4: Write
func (t *MockRPCResult) Write(proto tl.Encoder) (err error) {
val0 := t.Arg
if err = proto.WriteTypeBegin(builtin.TL_ID_VECTOR_T); err != nil {
return err
}
if err = proto.WriteInt(int32(len(val0))); err != nil {
return err
}
for _, val1 := range val0 {
if err = proto.WriteInt(val1); err != nil {
return err
}
}
if err = proto.WriteTypeEnd(); err != nil {
return err
}
return
}
示例5: Write
func (t *Double) Write(proto tl.Encoder) (err error) {
err = proto.WriteDouble(t.value)
return
}
示例6: Write
func (t *Bytes) Write(proto tl.Encoder) (err error) {
err = proto.WriteBytes(t.value)
return
}
示例7: Write
func (t *String) Write(proto tl.Encoder) (err error) {
err = proto.WriteString(t.value)
return
}
示例8: Write
func (t *Int) Write(proto tl.Encoder) (err error) {
err = proto.WriteInt(t.value)
return
}