2024-05-17 18:02:10 +08:00
|
|
|
// Code generated by Kitex v0.9.0. DO NOT EDIT.
|
|
|
|
|
|
|
|
package push
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"fmt"
|
|
|
|
"reflect"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/apache/thrift/lib/go/thrift"
|
|
|
|
|
|
|
|
"github.com/cloudwego/kitex/pkg/protocol/bthrift"
|
|
|
|
|
|
|
|
"gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/config"
|
|
|
|
)
|
|
|
|
|
|
|
|
// unused protection
|
|
|
|
var (
|
|
|
|
_ = fmt.Formatter(nil)
|
|
|
|
_ = (*bytes.Buffer)(nil)
|
|
|
|
_ = (*strings.Builder)(nil)
|
|
|
|
_ = reflect.Type(nil)
|
|
|
|
_ = thrift.TProtocol(nil)
|
|
|
|
_ = bthrift.BinaryWriter(nil)
|
|
|
|
_ = config.KitexUnusedProtection
|
|
|
|
)
|
|
|
|
|
|
|
|
func (p *PushReq) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
2024-05-20 17:57:25 +08:00
|
|
|
var issetIds bool = false
|
2024-05-17 18:02:10 +08:00
|
|
|
var issetTitle bool = false
|
|
|
|
var issetContent bool = false
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
2024-05-20 17:57:25 +08:00
|
|
|
if fieldTypeId == thrift.LIST {
|
2024-05-17 18:02:10 +08:00
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
2024-05-20 17:57:25 +08:00
|
|
|
issetIds = true
|
2024-05-17 18:02:10 +08:00
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
if fieldTypeId == thrift.STRING {
|
|
|
|
l, err = p.FastReadField2(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
issetTitle = true
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
if fieldTypeId == thrift.STRING {
|
|
|
|
l, err = p.FastReadField3(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
issetContent = true
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
if !issetIds {
|
2024-05-17 18:02:10 +08:00
|
|
|
fieldId = 1
|
|
|
|
goto RequiredFieldNotSetError
|
|
|
|
}
|
|
|
|
|
|
|
|
if !issetTitle {
|
|
|
|
fieldId = 2
|
|
|
|
goto RequiredFieldNotSetError
|
|
|
|
}
|
|
|
|
|
|
|
|
if !issetContent {
|
|
|
|
fieldId = 3
|
|
|
|
goto RequiredFieldNotSetError
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushReq[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
RequiredFieldNotSetError:
|
|
|
|
return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PushReq[fieldId]))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) FastReadField1(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
_, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
2024-05-17 18:02:10 +08:00
|
|
|
return offset, err
|
2024-05-20 17:57:25 +08:00
|
|
|
}
|
|
|
|
p.Ids = make([]int64, 0, size)
|
|
|
|
for i := 0; i < size; i++ {
|
|
|
|
var _elem int64
|
|
|
|
if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
2024-05-17 18:02:10 +08:00
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
_elem = v
|
2024-05-17 18:02:10 +08:00
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
p.Ids = append(p.Ids, _elem)
|
|
|
|
}
|
|
|
|
if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) FastReadField2(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.Title = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) FastReadField3(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.Content = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushReq) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "PushReq")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField2(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField3(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("PushReq")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
l += p.field2Length()
|
|
|
|
l += p.field3Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "ids", thrift.LIST, 1)
|
|
|
|
listBeginOffset := offset
|
|
|
|
offset += bthrift.Binary.ListBeginLength(thrift.I64, 0)
|
|
|
|
var length int
|
|
|
|
for _, v := range p.Ids {
|
|
|
|
length++
|
|
|
|
offset += bthrift.Binary.WriteI64(buf[offset:], v)
|
2024-05-17 18:02:10 +08:00
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
}
|
|
|
|
bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length)
|
|
|
|
offset += bthrift.Binary.WriteListEnd(buf[offset:])
|
2024-05-17 18:02:10 +08:00
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "title", thrift.STRING, 2)
|
|
|
|
offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Title)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "content", thrift.STRING, 3)
|
|
|
|
offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Content)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) field1Length() int {
|
|
|
|
l := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
l += bthrift.Binary.FieldBeginLength("ids", thrift.LIST, 1)
|
|
|
|
l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.Ids))
|
|
|
|
var tmpV int64
|
|
|
|
l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.Ids)
|
|
|
|
l += bthrift.Binary.ListEndLength()
|
2024-05-17 18:02:10 +08:00
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) field2Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("title", thrift.STRING, 2)
|
|
|
|
l += bthrift.Binary.StringLengthNocopy(p.Title)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushReq) field3Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("content", thrift.STRING, 3)
|
|
|
|
l += bthrift.Binary.StringLengthNocopy(p.Content)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) FastRead(buf []byte) (int, error) {
|
2024-05-17 18:02:10 +08:00
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
2024-05-20 17:57:25 +08:00
|
|
|
var issetCode bool = false
|
2024-05-17 18:02:10 +08:00
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
|
|
|
if fieldTypeId == thrift.I64 {
|
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
2024-05-20 17:57:25 +08:00
|
|
|
issetCode = true
|
2024-05-17 18:02:10 +08:00
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
if fieldTypeId == thrift.STRING {
|
|
|
|
l, err = p.FastReadField2(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
if fieldTypeId == thrift.STRING {
|
|
|
|
l, err = p.FastReadField3(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
if !issetCode {
|
2024-05-17 18:02:10 +08:00
|
|
|
fieldId = 1
|
|
|
|
goto RequiredFieldNotSetError
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
2024-05-20 17:57:25 +08:00
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Resp[fieldId]), err)
|
2024-05-17 18:02:10 +08:00
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
RequiredFieldNotSetError:
|
2024-05-20 17:57:25 +08:00
|
|
|
return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_Resp[fieldId]))
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) FastReadField1(buf []byte) (int, error) {
|
2024-05-17 18:02:10 +08:00
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
p.Code = v
|
2024-05-17 18:02:10 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) FastReadField2(buf []byte) (int, error) {
|
2024-05-17 18:02:10 +08:00
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
p.Msg = v
|
2024-05-17 18:02:10 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) FastReadField3(buf []byte) (int, error) {
|
2024-05-17 18:02:10 +08:00
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.MsgId = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) FastWrite(buf []byte) int {
|
2024-05-17 18:02:10 +08:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
2024-05-17 18:02:10 +08:00
|
|
|
offset := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Resp")
|
2024-05-17 18:02:10 +08:00
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField2(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField3(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) BLength() int {
|
2024-05-17 18:02:10 +08:00
|
|
|
l := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
l += bthrift.Binary.StructBeginLength("Resp")
|
2024-05-17 18:02:10 +08:00
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
l += p.field2Length()
|
|
|
|
l += p.field3Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
2024-05-17 18:02:10 +08:00
|
|
|
offset := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "code", thrift.I64, 1)
|
|
|
|
offset += bthrift.Binary.WriteI64(buf[offset:], p.Code)
|
2024-05-17 18:02:10 +08:00
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
2024-05-17 18:02:10 +08:00
|
|
|
offset := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "msg", thrift.STRING, 2)
|
|
|
|
offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Msg)
|
2024-05-17 18:02:10 +08:00
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
2024-05-17 18:02:10 +08:00
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "msgId", thrift.STRING, 3)
|
|
|
|
offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.MsgId)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) field1Length() int {
|
2024-05-17 18:02:10 +08:00
|
|
|
l := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
l += bthrift.Binary.FieldBeginLength("code", thrift.I64, 1)
|
|
|
|
l += bthrift.Binary.I64Length(p.Code)
|
2024-05-17 18:02:10 +08:00
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) field2Length() int {
|
2024-05-17 18:02:10 +08:00
|
|
|
l := 0
|
2024-05-20 17:57:25 +08:00
|
|
|
l += bthrift.Binary.FieldBeginLength("msg", thrift.STRING, 2)
|
|
|
|
l += bthrift.Binary.StringLengthNocopy(p.Msg)
|
2024-05-17 18:02:10 +08:00
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *Resp) field3Length() int {
|
2024-05-17 18:02:10 +08:00
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("msgId", thrift.STRING, 3)
|
|
|
|
l += bthrift.Binary.StringLengthNocopy(p.MsgId)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
|
|
|
if fieldTypeId == thrift.STRING {
|
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
if fieldTypeId == thrift.I64 {
|
|
|
|
l, err = p.FastReadField2(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
if fieldTypeId == thrift.I16 {
|
|
|
|
l, err = p.FastReadField3(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 4:
|
|
|
|
if fieldTypeId == thrift.BOOL {
|
|
|
|
l, err = p.FastReadField4(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ListPusherRequest[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) FastReadField1(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.Keyword = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) FastReadField2(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.Page = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) FastReadField3(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadI16(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.Size = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) FastReadField4(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.All = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *ListPusherRequest) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ListPusherRequest")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField2(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField3(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField4(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("ListPusherRequest")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
l += p.field2Length()
|
|
|
|
l += p.field3Length()
|
|
|
|
l += p.field4Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "keyword", thrift.STRING, 1)
|
|
|
|
offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Keyword)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
if p.IsSetPage() {
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "page", thrift.I64, 2)
|
|
|
|
offset += bthrift.Binary.WriteI64(buf[offset:], p.Page)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
}
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
if p.IsSetSize() {
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "size", thrift.I16, 3)
|
|
|
|
offset += bthrift.Binary.WriteI16(buf[offset:], p.Size)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
}
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "all", thrift.BOOL, 4)
|
|
|
|
offset += bthrift.Binary.WriteBool(buf[offset:], p.All)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) field1Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("keyword", thrift.STRING, 1)
|
|
|
|
l += bthrift.Binary.StringLengthNocopy(p.Keyword)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) field2Length() int {
|
|
|
|
l := 0
|
|
|
|
if p.IsSetPage() {
|
|
|
|
l += bthrift.Binary.FieldBeginLength("page", thrift.I64, 2)
|
|
|
|
l += bthrift.Binary.I64Length(p.Page)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
}
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) field3Length() int {
|
|
|
|
l := 0
|
|
|
|
if p.IsSetSize() {
|
|
|
|
l += bthrift.Binary.FieldBeginLength("size", thrift.I16, 3)
|
|
|
|
l += bthrift.Binary.I16Length(p.Size)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
}
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherRequest) field4Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("all", thrift.BOOL, 4)
|
|
|
|
l += bthrift.Binary.BoolLength(p.All)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
|
|
|
if fieldTypeId == thrift.I64 {
|
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
if fieldTypeId == thrift.LIST {
|
|
|
|
l, err = p.FastReadField2(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ListPusherResponse[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) FastReadField1(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
|
|
|
|
p.Total = v
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) FastReadField2(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
_, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
return offset, err
|
|
|
|
}
|
2024-05-20 17:57:25 +08:00
|
|
|
p.List = make([]*config.PusherConfig, 0, size)
|
2024-05-17 18:02:10 +08:00
|
|
|
for i := 0; i < size; i++ {
|
2024-05-20 17:57:25 +08:00
|
|
|
_elem := config.NewPusherConfig()
|
2024-05-17 18:02:10 +08:00
|
|
|
if l, err := _elem.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
|
|
|
|
p.List = append(p.List, _elem)
|
|
|
|
}
|
|
|
|
if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *ListPusherResponse) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ListPusherResponse")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
offset += p.fastWriteField2(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("ListPusherResponse")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
l += p.field2Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "total", thrift.I64, 1)
|
|
|
|
offset += bthrift.Binary.WriteI64(buf[offset:], p.Total)
|
|
|
|
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "list", thrift.LIST, 2)
|
|
|
|
listBeginOffset := offset
|
|
|
|
offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0)
|
|
|
|
var length int
|
|
|
|
for _, v := range p.List {
|
|
|
|
length++
|
|
|
|
offset += v.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length)
|
|
|
|
offset += bthrift.Binary.WriteListEnd(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) field1Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("total", thrift.I64, 1)
|
|
|
|
l += bthrift.Binary.I64Length(p.Total)
|
|
|
|
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ListPusherResponse) field2Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("list", thrift.LIST, 2)
|
|
|
|
l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.List))
|
|
|
|
for _, v := range p.List {
|
|
|
|
l += v.BLength()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.ListEndLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *GetPusherOptionsResponse) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
2024-05-21 14:01:28 +08:00
|
|
|
if fieldTypeId == thrift.LIST {
|
2024-05-20 17:57:25 +08:00
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetPusherOptionsResponse[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *GetPusherOptionsResponse) FastReadField1(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
2024-05-21 14:01:28 +08:00
|
|
|
_, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:])
|
2024-05-20 17:57:25 +08:00
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
return offset, err
|
|
|
|
}
|
2024-05-21 14:01:28 +08:00
|
|
|
p.Options = make([]*config.PusherOption, 0, size)
|
2024-05-20 17:57:25 +08:00
|
|
|
for i := 0; i < size; i++ {
|
2024-05-21 14:01:28 +08:00
|
|
|
_elem := config.NewPusherOption()
|
|
|
|
if l, err := _elem.FastRead(buf[offset:]); err != nil {
|
2024-05-20 17:57:25 +08:00
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
|
2024-05-21 14:01:28 +08:00
|
|
|
p.Options = append(p.Options, _elem)
|
2024-05-20 17:57:25 +08:00
|
|
|
}
|
2024-05-21 14:01:28 +08:00
|
|
|
if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil {
|
2024-05-20 17:57:25 +08:00
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *GetPusherOptionsResponse) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *GetPusherOptionsResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetPusherOptionsResponse")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *GetPusherOptionsResponse) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("GetPusherOptionsResponse")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *GetPusherOptionsResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
2024-05-21 14:01:28 +08:00
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "options", thrift.LIST, 1)
|
|
|
|
listBeginOffset := offset
|
|
|
|
offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0)
|
2024-05-20 17:57:25 +08:00
|
|
|
var length int
|
2024-05-21 14:01:28 +08:00
|
|
|
for _, v := range p.Options {
|
2024-05-20 17:57:25 +08:00
|
|
|
length++
|
2024-05-21 14:01:28 +08:00
|
|
|
offset += v.FastWriteNocopy(buf[offset:], binaryWriter)
|
2024-05-20 17:57:25 +08:00
|
|
|
}
|
2024-05-21 14:01:28 +08:00
|
|
|
bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length)
|
|
|
|
offset += bthrift.Binary.WriteListEnd(buf[offset:])
|
2024-05-20 17:57:25 +08:00
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *GetPusherOptionsResponse) field1Length() int {
|
|
|
|
l := 0
|
2024-05-21 14:01:28 +08:00
|
|
|
l += bthrift.Binary.FieldBeginLength("options", thrift.LIST, 1)
|
|
|
|
l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Options))
|
|
|
|
for _, v := range p.Options {
|
|
|
|
l += v.BLength()
|
2024-05-20 17:57:25 +08:00
|
|
|
}
|
2024-05-21 14:01:28 +08:00
|
|
|
l += bthrift.Binary.ListEndLength()
|
2024-05-20 17:57:25 +08:00
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-17 18:02:10 +08:00
|
|
|
func (p *PushServicePushArgs) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
|
|
|
if fieldTypeId == thrift.STRUCT {
|
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServicePushArgs[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushArgs) FastReadField1(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
tmp := NewPushReq()
|
|
|
|
if l, err := tmp.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
p.Req = tmp
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushServicePushArgs) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Push_args")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushArgs) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("Push_args")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1)
|
|
|
|
offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushArgs) field1Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1)
|
|
|
|
l += p.Req.BLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushResult) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 0:
|
|
|
|
if fieldTypeId == thrift.STRUCT {
|
|
|
|
l, err = p.FastReadField0(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServicePushResult[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushResult) FastReadField0(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
tmp := NewResp()
|
2024-05-17 18:02:10 +08:00
|
|
|
if l, err := tmp.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
p.Success = tmp
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushServicePushResult) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Push_result")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField0(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushResult) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("Push_result")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field0Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0)
|
|
|
|
offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
}
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushResult) field0Length() int {
|
|
|
|
l := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0)
|
|
|
|
l += p.Success.BLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
}
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddArgs) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
|
|
|
if fieldTypeId == thrift.STRUCT {
|
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceAddArgs[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddArgs) FastReadField1(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
tmp := config.NewPusherConfig()
|
2024-05-17 18:02:10 +08:00
|
|
|
if l, err := tmp.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
p.Req = tmp
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushServiceAddArgs) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Add_args")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddArgs) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("Add_args")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1)
|
|
|
|
offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddArgs) field1Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1)
|
|
|
|
l += p.Req.BLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddResult) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
2024-05-20 17:57:25 +08:00
|
|
|
switch fieldId {
|
|
|
|
case 0:
|
|
|
|
if fieldTypeId == thrift.STRUCT {
|
|
|
|
l, err = p.FastReadField0(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
2024-05-20 17:57:25 +08:00
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceAddResult[fieldId]), err)
|
2024-05-17 18:02:10 +08:00
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *PushServiceAddResult) FastReadField0(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
tmp := NewResp()
|
|
|
|
if l, err := tmp.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
p.Success = tmp
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
2024-05-17 18:02:10 +08:00
|
|
|
// for compatibility
|
|
|
|
func (p *PushServiceAddResult) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Add_result")
|
|
|
|
if p != nil {
|
2024-05-20 17:57:25 +08:00
|
|
|
offset += p.fastWriteField0(buf[offset:], binaryWriter)
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddResult) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("Add_result")
|
|
|
|
if p != nil {
|
2024-05-20 17:57:25 +08:00
|
|
|
l += p.field0Length()
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *PushServiceAddResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0)
|
|
|
|
offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
}
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddResult) field0Length() int {
|
|
|
|
l := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0)
|
|
|
|
l += p.Success.BLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
}
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-17 18:02:10 +08:00
|
|
|
func (p *PushServiceListArgs) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 1:
|
|
|
|
if fieldTypeId == thrift.STRUCT {
|
|
|
|
l, err = p.FastReadField1(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceListArgs[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListArgs) FastReadField1(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
tmp := NewListPusherRequest()
|
|
|
|
if l, err := tmp.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
p.Req = tmp
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushServiceListArgs) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "List_args")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField1(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListArgs) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("List_args")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field1Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1)
|
|
|
|
offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListArgs) field1Length() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1)
|
|
|
|
l += p.Req.BLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListResult) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 0:
|
|
|
|
if fieldTypeId == thrift.STRUCT {
|
|
|
|
l, err = p.FastReadField0(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceListResult[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListResult) FastReadField0(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
tmp := NewListPusherResponse()
|
|
|
|
if l, err := tmp.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
p.Success = tmp
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushServiceListResult) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "List_result")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField0(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListResult) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("List_result")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field0Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0)
|
|
|
|
offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
}
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListResult) field0Length() int {
|
|
|
|
l := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0)
|
|
|
|
l += p.Success.BLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
}
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
func (p *PushServiceGetPusherOptionsArgs) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetPusherOptions_args")
|
|
|
|
if p != nil {
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("GetPusherOptions_args")
|
|
|
|
if p != nil {
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) FastRead(buf []byte) (int, error) {
|
|
|
|
var err error
|
|
|
|
var offset int
|
|
|
|
var l int
|
|
|
|
var fieldTypeId thrift.TType
|
|
|
|
var fieldId int16
|
|
|
|
_, l, err = bthrift.Binary.ReadStructBegin(buf)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructBeginError
|
|
|
|
}
|
|
|
|
|
|
|
|
for {
|
|
|
|
_, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldBeginError
|
|
|
|
}
|
|
|
|
if fieldTypeId == thrift.STOP {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
switch fieldId {
|
|
|
|
case 0:
|
|
|
|
if fieldTypeId == thrift.STRUCT {
|
|
|
|
l, err = p.FastReadField0(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldError
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId)
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto SkipFieldError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
l, err = bthrift.Binary.ReadFieldEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadFieldEndError
|
|
|
|
}
|
|
|
|
}
|
|
|
|
l, err = bthrift.Binary.ReadStructEnd(buf[offset:])
|
|
|
|
offset += l
|
|
|
|
if err != nil {
|
|
|
|
goto ReadStructEndError
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset, nil
|
|
|
|
ReadStructBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
|
|
ReadFieldBeginError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
|
|
ReadFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceGetPusherOptionsResult[fieldId]), err)
|
|
|
|
SkipFieldError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
|
|
ReadStructEndError:
|
|
|
|
return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) FastReadField0(buf []byte) (int, error) {
|
|
|
|
offset := 0
|
|
|
|
|
|
|
|
tmp := NewGetPusherOptionsResponse()
|
|
|
|
if l, err := tmp.FastRead(buf[offset:]); err != nil {
|
|
|
|
return offset, err
|
|
|
|
} else {
|
|
|
|
offset += l
|
|
|
|
}
|
|
|
|
p.Success = tmp
|
|
|
|
return offset, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// for compatibility
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) FastWrite(buf []byte) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetPusherOptions_result")
|
|
|
|
if p != nil {
|
|
|
|
offset += p.fastWriteField0(buf[offset:], binaryWriter)
|
|
|
|
}
|
|
|
|
offset += bthrift.Binary.WriteFieldStop(buf[offset:])
|
|
|
|
offset += bthrift.Binary.WriteStructEnd(buf[offset:])
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) BLength() int {
|
|
|
|
l := 0
|
|
|
|
l += bthrift.Binary.StructBeginLength("GetPusherOptions_result")
|
|
|
|
if p != nil {
|
|
|
|
l += p.field0Length()
|
|
|
|
}
|
|
|
|
l += bthrift.Binary.FieldStopLength()
|
|
|
|
l += bthrift.Binary.StructEndLength()
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
|
|
|
offset := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0)
|
|
|
|
offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter)
|
|
|
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
|
|
|
}
|
|
|
|
return offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) field0Length() int {
|
|
|
|
l := 0
|
|
|
|
if p.IsSetSuccess() {
|
|
|
|
l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0)
|
|
|
|
l += p.Success.BLength()
|
|
|
|
l += bthrift.Binary.FieldEndLength()
|
|
|
|
}
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-05-17 18:02:10 +08:00
|
|
|
func (p *PushServicePushArgs) GetFirstArgument() interface{} {
|
|
|
|
return p.Req
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServicePushResult) GetResult() interface{} {
|
|
|
|
return p.Success
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddArgs) GetFirstArgument() interface{} {
|
|
|
|
return p.Req
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceAddResult) GetResult() interface{} {
|
2024-05-20 17:57:25 +08:00
|
|
|
return p.Success
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListArgs) GetFirstArgument() interface{} {
|
|
|
|
return p.Req
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceListResult) GetResult() interface{} {
|
|
|
|
return p.Success
|
|
|
|
}
|
2024-05-20 17:57:25 +08:00
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) GetFirstArgument() interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) GetResult() interface{} {
|
|
|
|
return p.Success
|
|
|
|
}
|