1737 lines
44 KiB
Go
1737 lines
44 KiB
Go
|
// 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
|
||
|
var issetId bool = false
|
||
|
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:
|
||
|
if fieldTypeId == thrift.I64 {
|
||
|
l, err = p.FastReadField1(buf[offset:])
|
||
|
offset += l
|
||
|
if err != nil {
|
||
|
goto ReadFieldError
|
||
|
}
|
||
|
issetId = true
|
||
|
} 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
|
||
|
}
|
||
|
|
||
|
if !issetId {
|
||
|
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
|
||
|
|
||
|
if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil {
|
||
|
return offset, err
|
||
|
} else {
|
||
|
offset += l
|
||
|
|
||
|
p.Id = v
|
||
|
|
||
|
}
|
||
|
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
|
||
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1)
|
||
|
offset += bthrift.Binary.WriteI64(buf[offset:], p.Id)
|
||
|
|
||
|
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
|
||
|
l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1)
|
||
|
l += bthrift.Binary.I64Length(p.Id)
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) FastRead(buf []byte) (int, error) {
|
||
|
var err error
|
||
|
var offset int
|
||
|
var l int
|
||
|
var fieldTypeId thrift.TType
|
||
|
var fieldId int16
|
||
|
var issetErrCode 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:
|
||
|
if fieldTypeId == thrift.I64 {
|
||
|
l, err = p.FastReadField1(buf[offset:])
|
||
|
offset += l
|
||
|
if err != nil {
|
||
|
goto ReadFieldError
|
||
|
}
|
||
|
issetErrCode = true
|
||
|
} 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
|
||
|
}
|
||
|
|
||
|
if !issetErrCode {
|
||
|
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:
|
||
|
return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushResp[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_PushResp[fieldId]))
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) 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.ErrCode = v
|
||
|
|
||
|
}
|
||
|
return offset, nil
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) 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.ErrMsg = v
|
||
|
|
||
|
}
|
||
|
return offset, nil
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) 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.MsgId = v
|
||
|
|
||
|
}
|
||
|
return offset, nil
|
||
|
}
|
||
|
|
||
|
// for compatibility
|
||
|
func (p *PushResp) FastWrite(buf []byte) int {
|
||
|
return 0
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
||
|
offset := 0
|
||
|
offset += bthrift.Binary.WriteStructBegin(buf[offset:], "PushResp")
|
||
|
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 *PushResp) BLength() int {
|
||
|
l := 0
|
||
|
l += bthrift.Binary.StructBeginLength("PushResp")
|
||
|
if p != nil {
|
||
|
l += p.field1Length()
|
||
|
l += p.field2Length()
|
||
|
l += p.field3Length()
|
||
|
}
|
||
|
l += bthrift.Binary.FieldStopLength()
|
||
|
l += bthrift.Binary.StructEndLength()
|
||
|
return l
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
||
|
offset := 0
|
||
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "errCode", thrift.I64, 1)
|
||
|
offset += bthrift.Binary.WriteI64(buf[offset:], p.ErrCode)
|
||
|
|
||
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
||
|
return offset
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
||
|
offset := 0
|
||
|
offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "errMsg", thrift.STRING, 2)
|
||
|
offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.ErrMsg)
|
||
|
|
||
|
offset += bthrift.Binary.WriteFieldEnd(buf[offset:])
|
||
|
return offset
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int {
|
||
|
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
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) field1Length() int {
|
||
|
l := 0
|
||
|
l += bthrift.Binary.FieldBeginLength("errCode", thrift.I64, 1)
|
||
|
l += bthrift.Binary.I64Length(p.ErrCode)
|
||
|
|
||
|
l += bthrift.Binary.FieldEndLength()
|
||
|
return l
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) field2Length() int {
|
||
|
l := 0
|
||
|
l += bthrift.Binary.FieldBeginLength("errMsg", thrift.STRING, 2)
|
||
|
l += bthrift.Binary.StringLengthNocopy(p.ErrMsg)
|
||
|
|
||
|
l += bthrift.Binary.FieldEndLength()
|
||
|
return l
|
||
|
}
|
||
|
|
||
|
func (p *PushResp) field3Length() int {
|
||
|
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
|
||
|
}
|
||
|
p.List = make([]*config.PushConfig, 0, size)
|
||
|
for i := 0; i < size; i++ {
|
||
|
_elem := config.NewPushConfig()
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
|
||
|
tmp := NewPushResp()
|
||
|
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
|
||
|
|
||
|
tmp := config.NewPushConfig()
|
||
|
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
|
||
|
}
|
||
|
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 *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 {
|
||
|
}
|
||
|
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 {
|
||
|
}
|
||
|
l += bthrift.Binary.FieldStopLength()
|
||
|
l += bthrift.Binary.StructEndLength()
|
||
|
return l
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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{} {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (p *PushServiceListArgs) GetFirstArgument() interface{} {
|
||
|
return p.Req
|
||
|
}
|
||
|
|
||
|
func (p *PushServiceListResult) GetResult() interface{} {
|
||
|
return p.Success
|
||
|
}
|