Beispiel #1
0
func (t *RpcError) Write(proto tl.Encoder) (err error) {
	err = proto.WriteInt(t.ErrorCode)
	if err != nil {
		return
	}
	err = proto.WriteString(t.ErrorMessage)
	return
}
Beispiel #2
0
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
}
Beispiel #3
0
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
}
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
}
Beispiel #5
0
func (t *Double) Write(proto tl.Encoder) (err error) {
	err = proto.WriteDouble(t.value)
	return
}
Beispiel #6
0
func (t *Bytes) Write(proto tl.Encoder) (err error) {
	err = proto.WriteBytes(t.value)
	return
}
Beispiel #7
0
func (t *String) Write(proto tl.Encoder) (err error) {
	err = proto.WriteString(t.value)
	return
}
Beispiel #8
0
func (t *Int) Write(proto tl.Encoder) (err error) {
	err = proto.WriteInt(t.value)
	return
}