3032 lines
76 KiB
Go
3032 lines
76 KiB
Go
// Code generated by thriftgo (0.3.18). DO NOT EDIT.
|
|
|
|
package push
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/config"
|
|
"github.com/apache/thrift/lib/go/thrift"
|
|
"strings"
|
|
)
|
|
|
|
type PushReq struct {
|
|
Ids []int64 `thrift:"ids,1" frugal:"1,default,list<i64>" json:"ids"`
|
|
Title string `thrift:"title,2,required" frugal:"2,required,string" json:"title"`
|
|
Content string `thrift:"content,3,required" frugal:"3,required,string" json:"content"`
|
|
}
|
|
|
|
func NewPushReq() *PushReq {
|
|
return &PushReq{}
|
|
}
|
|
|
|
func (p *PushReq) InitDefault() {
|
|
}
|
|
|
|
func (p *PushReq) GetIds() (v []int64) {
|
|
return p.Ids
|
|
}
|
|
|
|
func (p *PushReq) GetTitle() (v string) {
|
|
return p.Title
|
|
}
|
|
|
|
func (p *PushReq) GetContent() (v string) {
|
|
return p.Content
|
|
}
|
|
func (p *PushReq) SetIds(val []int64) {
|
|
p.Ids = val
|
|
}
|
|
func (p *PushReq) SetTitle(val string) {
|
|
p.Title = val
|
|
}
|
|
func (p *PushReq) SetContent(val string) {
|
|
p.Content = val
|
|
}
|
|
|
|
var fieldIDToName_PushReq = map[int16]string{
|
|
1: "ids",
|
|
2: "title",
|
|
3: "content",
|
|
}
|
|
|
|
func (p *PushReq) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
var issetTitle bool = false
|
|
var issetContent bool = false
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.LIST {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 2:
|
|
if fieldTypeId == thrift.STRING {
|
|
if err = p.ReadField2(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
issetTitle = true
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 3:
|
|
if fieldTypeId == thrift.STRING {
|
|
if err = p.ReadField3(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
issetContent = true
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
if !issetTitle {
|
|
fieldId = 2
|
|
goto RequiredFieldNotSetError
|
|
}
|
|
|
|
if !issetContent {
|
|
fieldId = 3
|
|
goto RequiredFieldNotSetError
|
|
}
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushReq[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
RequiredFieldNotSetError:
|
|
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PushReq[fieldId]))
|
|
}
|
|
|
|
func (p *PushReq) ReadField1(iprot thrift.TProtocol) error {
|
|
_, size, err := iprot.ReadListBegin()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_field := make([]int64, 0, size)
|
|
for i := 0; i < size; i++ {
|
|
|
|
var _elem int64
|
|
if v, err := iprot.ReadI64(); err != nil {
|
|
return err
|
|
} else {
|
|
_elem = v
|
|
}
|
|
|
|
_field = append(_field, _elem)
|
|
}
|
|
if err := iprot.ReadListEnd(); err != nil {
|
|
return err
|
|
}
|
|
p.Ids = _field
|
|
return nil
|
|
}
|
|
func (p *PushReq) ReadField2(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Title = _field
|
|
return nil
|
|
}
|
|
func (p *PushReq) ReadField3(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Content = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushReq) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("PushReq"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField2(oprot); err != nil {
|
|
fieldId = 2
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField3(oprot); err != nil {
|
|
fieldId = 3
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushReq) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("ids", thrift.LIST, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteListBegin(thrift.I64, len(p.Ids)); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range p.Ids {
|
|
if err := oprot.WriteI64(v); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if err := oprot.WriteListEnd(); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushReq) writeField2(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("title", thrift.STRING, 2); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.Title); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushReq) writeField3(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("content", thrift.STRING, 3); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.Content); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushReq) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushReq(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushReq) DeepEqual(ano *PushReq) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Ids) {
|
|
return false
|
|
}
|
|
if !p.Field2DeepEqual(ano.Title) {
|
|
return false
|
|
}
|
|
if !p.Field3DeepEqual(ano.Content) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushReq) Field1DeepEqual(src []int64) bool {
|
|
|
|
if len(p.Ids) != len(src) {
|
|
return false
|
|
}
|
|
for i, v := range p.Ids {
|
|
_src := src[i]
|
|
if v != _src {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
func (p *PushReq) Field2DeepEqual(src string) bool {
|
|
|
|
if strings.Compare(p.Title, src) != 0 {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (p *PushReq) Field3DeepEqual(src string) bool {
|
|
|
|
if strings.Compare(p.Content, src) != 0 {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type Resp struct {
|
|
Code int64 `thrift:"code,1,required" frugal:"1,required,i64" json:"code"`
|
|
Msg string `thrift:"msg,2" frugal:"2,default,string" json:"msg"`
|
|
MsgId string `thrift:"msgId,3" frugal:"3,default,string" json:"msgId"`
|
|
}
|
|
|
|
func NewResp() *Resp {
|
|
return &Resp{}
|
|
}
|
|
|
|
func (p *Resp) InitDefault() {
|
|
}
|
|
|
|
func (p *Resp) GetCode() (v int64) {
|
|
return p.Code
|
|
}
|
|
|
|
func (p *Resp) GetMsg() (v string) {
|
|
return p.Msg
|
|
}
|
|
|
|
func (p *Resp) GetMsgId() (v string) {
|
|
return p.MsgId
|
|
}
|
|
func (p *Resp) SetCode(val int64) {
|
|
p.Code = val
|
|
}
|
|
func (p *Resp) SetMsg(val string) {
|
|
p.Msg = val
|
|
}
|
|
func (p *Resp) SetMsgId(val string) {
|
|
p.MsgId = val
|
|
}
|
|
|
|
var fieldIDToName_Resp = map[int16]string{
|
|
1: "code",
|
|
2: "msg",
|
|
3: "msgId",
|
|
}
|
|
|
|
func (p *Resp) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
var issetCode bool = false
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.I64 {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
issetCode = true
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 2:
|
|
if fieldTypeId == thrift.STRING {
|
|
if err = p.ReadField2(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 3:
|
|
if fieldTypeId == thrift.STRING {
|
|
if err = p.ReadField3(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
if !issetCode {
|
|
fieldId = 1
|
|
goto RequiredFieldNotSetError
|
|
}
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Resp[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
RequiredFieldNotSetError:
|
|
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_Resp[fieldId]))
|
|
}
|
|
|
|
func (p *Resp) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field int64
|
|
if v, err := iprot.ReadI64(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Code = _field
|
|
return nil
|
|
}
|
|
func (p *Resp) ReadField2(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Msg = _field
|
|
return nil
|
|
}
|
|
func (p *Resp) ReadField3(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.MsgId = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *Resp) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("Resp"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField2(oprot); err != nil {
|
|
fieldId = 2
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField3(oprot); err != nil {
|
|
fieldId = 3
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *Resp) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("code", thrift.I64, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteI64(p.Code); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *Resp) writeField2(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.Msg); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
|
}
|
|
|
|
func (p *Resp) writeField3(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("msgId", thrift.STRING, 3); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.MsgId); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
|
}
|
|
|
|
func (p *Resp) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("Resp(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *Resp) DeepEqual(ano *Resp) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Code) {
|
|
return false
|
|
}
|
|
if !p.Field2DeepEqual(ano.Msg) {
|
|
return false
|
|
}
|
|
if !p.Field3DeepEqual(ano.MsgId) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *Resp) Field1DeepEqual(src int64) bool {
|
|
|
|
if p.Code != src {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (p *Resp) Field2DeepEqual(src string) bool {
|
|
|
|
if strings.Compare(p.Msg, src) != 0 {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (p *Resp) Field3DeepEqual(src string) bool {
|
|
|
|
if strings.Compare(p.MsgId, src) != 0 {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type ListPusherRequest struct {
|
|
Keyword string `thrift:"keyword,1" frugal:"1,default,string" json:"keyword"`
|
|
Page int64 `thrift:"page,2,optional" frugal:"2,optional,i64" json:"page,omitempty"`
|
|
Size int16 `thrift:"size,3,optional" frugal:"3,optional,i16" json:"size,omitempty"`
|
|
All bool `thrift:"all,4" frugal:"4,default,bool" json:"all"`
|
|
}
|
|
|
|
func NewListPusherRequest() *ListPusherRequest {
|
|
return &ListPusherRequest{
|
|
|
|
Page: 10,
|
|
Size: 1,
|
|
}
|
|
}
|
|
|
|
func (p *ListPusherRequest) InitDefault() {
|
|
p.Page = 10
|
|
p.Size = 1
|
|
}
|
|
|
|
func (p *ListPusherRequest) GetKeyword() (v string) {
|
|
return p.Keyword
|
|
}
|
|
|
|
var ListPusherRequest_Page_DEFAULT int64 = 10
|
|
|
|
func (p *ListPusherRequest) GetPage() (v int64) {
|
|
if !p.IsSetPage() {
|
|
return ListPusherRequest_Page_DEFAULT
|
|
}
|
|
return p.Page
|
|
}
|
|
|
|
var ListPusherRequest_Size_DEFAULT int16 = 1
|
|
|
|
func (p *ListPusherRequest) GetSize() (v int16) {
|
|
if !p.IsSetSize() {
|
|
return ListPusherRequest_Size_DEFAULT
|
|
}
|
|
return p.Size
|
|
}
|
|
|
|
func (p *ListPusherRequest) GetAll() (v bool) {
|
|
return p.All
|
|
}
|
|
func (p *ListPusherRequest) SetKeyword(val string) {
|
|
p.Keyword = val
|
|
}
|
|
func (p *ListPusherRequest) SetPage(val int64) {
|
|
p.Page = val
|
|
}
|
|
func (p *ListPusherRequest) SetSize(val int16) {
|
|
p.Size = val
|
|
}
|
|
func (p *ListPusherRequest) SetAll(val bool) {
|
|
p.All = val
|
|
}
|
|
|
|
var fieldIDToName_ListPusherRequest = map[int16]string{
|
|
1: "keyword",
|
|
2: "page",
|
|
3: "size",
|
|
4: "all",
|
|
}
|
|
|
|
func (p *ListPusherRequest) IsSetPage() bool {
|
|
return p.Page != ListPusherRequest_Page_DEFAULT
|
|
}
|
|
|
|
func (p *ListPusherRequest) IsSetSize() bool {
|
|
return p.Size != ListPusherRequest_Size_DEFAULT
|
|
}
|
|
|
|
func (p *ListPusherRequest) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.STRING {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 2:
|
|
if fieldTypeId == thrift.I64 {
|
|
if err = p.ReadField2(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 3:
|
|
if fieldTypeId == thrift.I16 {
|
|
if err = p.ReadField3(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 4:
|
|
if fieldTypeId == thrift.BOOL {
|
|
if err = p.ReadField4(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ListPusherRequest[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherRequest) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Keyword = _field
|
|
return nil
|
|
}
|
|
func (p *ListPusherRequest) ReadField2(iprot thrift.TProtocol) error {
|
|
|
|
var _field int64
|
|
if v, err := iprot.ReadI64(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Page = _field
|
|
return nil
|
|
}
|
|
func (p *ListPusherRequest) ReadField3(iprot thrift.TProtocol) error {
|
|
|
|
var _field int16
|
|
if v, err := iprot.ReadI16(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Size = _field
|
|
return nil
|
|
}
|
|
func (p *ListPusherRequest) ReadField4(iprot thrift.TProtocol) error {
|
|
|
|
var _field bool
|
|
if v, err := iprot.ReadBool(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.All = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *ListPusherRequest) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("ListPusherRequest"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField2(oprot); err != nil {
|
|
fieldId = 2
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField3(oprot); err != nil {
|
|
fieldId = 3
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField4(oprot); err != nil {
|
|
fieldId = 4
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherRequest) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("keyword", thrift.STRING, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.Keyword); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherRequest) writeField2(oprot thrift.TProtocol) (err error) {
|
|
if p.IsSetPage() {
|
|
if err = oprot.WriteFieldBegin("page", thrift.I64, 2); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteI64(p.Page); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherRequest) writeField3(oprot thrift.TProtocol) (err error) {
|
|
if p.IsSetSize() {
|
|
if err = oprot.WriteFieldBegin("size", thrift.I16, 3); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteI16(p.Size); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherRequest) writeField4(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("all", thrift.BOOL, 4); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteBool(p.All); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherRequest) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("ListPusherRequest(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *ListPusherRequest) DeepEqual(ano *ListPusherRequest) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Keyword) {
|
|
return false
|
|
}
|
|
if !p.Field2DeepEqual(ano.Page) {
|
|
return false
|
|
}
|
|
if !p.Field3DeepEqual(ano.Size) {
|
|
return false
|
|
}
|
|
if !p.Field4DeepEqual(ano.All) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *ListPusherRequest) Field1DeepEqual(src string) bool {
|
|
|
|
if strings.Compare(p.Keyword, src) != 0 {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (p *ListPusherRequest) Field2DeepEqual(src int64) bool {
|
|
|
|
if p.Page != src {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (p *ListPusherRequest) Field3DeepEqual(src int16) bool {
|
|
|
|
if p.Size != src {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (p *ListPusherRequest) Field4DeepEqual(src bool) bool {
|
|
|
|
if p.All != src {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type ListPusherResponse struct {
|
|
Total int64 `thrift:"total,1" frugal:"1,default,i64" json:"total"`
|
|
List []*config.PusherConfig `thrift:"list,2" frugal:"2,default,list<config.PusherConfig>" json:"list"`
|
|
}
|
|
|
|
func NewListPusherResponse() *ListPusherResponse {
|
|
return &ListPusherResponse{}
|
|
}
|
|
|
|
func (p *ListPusherResponse) InitDefault() {
|
|
}
|
|
|
|
func (p *ListPusherResponse) GetTotal() (v int64) {
|
|
return p.Total
|
|
}
|
|
|
|
func (p *ListPusherResponse) GetList() (v []*config.PusherConfig) {
|
|
return p.List
|
|
}
|
|
func (p *ListPusherResponse) SetTotal(val int64) {
|
|
p.Total = val
|
|
}
|
|
func (p *ListPusherResponse) SetList(val []*config.PusherConfig) {
|
|
p.List = val
|
|
}
|
|
|
|
var fieldIDToName_ListPusherResponse = map[int16]string{
|
|
1: "total",
|
|
2: "list",
|
|
}
|
|
|
|
func (p *ListPusherResponse) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.I64 {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
case 2:
|
|
if fieldTypeId == thrift.LIST {
|
|
if err = p.ReadField2(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ListPusherResponse[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherResponse) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field int64
|
|
if v, err := iprot.ReadI64(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.Total = _field
|
|
return nil
|
|
}
|
|
func (p *ListPusherResponse) ReadField2(iprot thrift.TProtocol) error {
|
|
_, size, err := iprot.ReadListBegin()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_field := make([]*config.PusherConfig, 0, size)
|
|
values := make([]config.PusherConfig, size)
|
|
for i := 0; i < size; i++ {
|
|
_elem := &values[i]
|
|
_elem.InitDefault()
|
|
|
|
if err := _elem.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
|
|
_field = append(_field, _elem)
|
|
}
|
|
if err := iprot.ReadListEnd(); err != nil {
|
|
return err
|
|
}
|
|
p.List = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *ListPusherResponse) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("ListPusherResponse"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
if err = p.writeField2(oprot); err != nil {
|
|
fieldId = 2
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherResponse) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("total", thrift.I64, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteI64(p.Total); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherResponse) writeField2(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("list", thrift.LIST, 2); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.List)); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range p.List {
|
|
if err := v.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if err := oprot.WriteListEnd(); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
|
}
|
|
|
|
func (p *ListPusherResponse) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("ListPusherResponse(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *ListPusherResponse) DeepEqual(ano *ListPusherResponse) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Total) {
|
|
return false
|
|
}
|
|
if !p.Field2DeepEqual(ano.List) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *ListPusherResponse) Field1DeepEqual(src int64) bool {
|
|
|
|
if p.Total != src {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (p *ListPusherResponse) Field2DeepEqual(src []*config.PusherConfig) bool {
|
|
|
|
if len(p.List) != len(src) {
|
|
return false
|
|
}
|
|
for i, v := range p.List {
|
|
_src := src[i]
|
|
if !v.DeepEqual(_src) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
type GetPusherOptionsResponse struct {
|
|
Options []*config.PusherOption `thrift:"options,1" frugal:"1,default,list<config.PusherOption>" json:"options"`
|
|
}
|
|
|
|
func NewGetPusherOptionsResponse() *GetPusherOptionsResponse {
|
|
return &GetPusherOptionsResponse{}
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) InitDefault() {
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) GetOptions() (v []*config.PusherOption) {
|
|
return p.Options
|
|
}
|
|
func (p *GetPusherOptionsResponse) SetOptions(val []*config.PusherOption) {
|
|
p.Options = val
|
|
}
|
|
|
|
var fieldIDToName_GetPusherOptionsResponse = map[int16]string{
|
|
1: "options",
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.LIST {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetPusherOptionsResponse[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) ReadField1(iprot thrift.TProtocol) error {
|
|
_, size, err := iprot.ReadListBegin()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_field := make([]*config.PusherOption, 0, size)
|
|
values := make([]config.PusherOption, size)
|
|
for i := 0; i < size; i++ {
|
|
_elem := &values[i]
|
|
_elem.InitDefault()
|
|
|
|
if err := _elem.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
|
|
_field = append(_field, _elem)
|
|
}
|
|
if err := iprot.ReadListEnd(); err != nil {
|
|
return err
|
|
}
|
|
p.Options = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("GetPusherOptionsResponse"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("options", thrift.LIST, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Options)); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range p.Options {
|
|
if err := v.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if err := oprot.WriteListEnd(); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("GetPusherOptionsResponse(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) DeepEqual(ano *GetPusherOptionsResponse) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Options) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *GetPusherOptionsResponse) Field1DeepEqual(src []*config.PusherOption) bool {
|
|
|
|
if len(p.Options) != len(src) {
|
|
return false
|
|
}
|
|
for i, v := range p.Options {
|
|
_src := src[i]
|
|
if !v.DeepEqual(_src) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushService interface {
|
|
Push(ctx context.Context, req *PushReq) (r *Resp, err error)
|
|
|
|
Add(ctx context.Context, req *config.PusherConfig) (r *Resp, err error)
|
|
|
|
List(ctx context.Context, req *ListPusherRequest) (r *ListPusherResponse, err error)
|
|
|
|
GetPusherOptions(ctx context.Context) (r *GetPusherOptionsResponse, err error)
|
|
}
|
|
|
|
type PushServiceClient struct {
|
|
c thrift.TClient
|
|
}
|
|
|
|
func NewPushServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PushServiceClient {
|
|
return &PushServiceClient{
|
|
c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
|
|
}
|
|
}
|
|
|
|
func NewPushServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PushServiceClient {
|
|
return &PushServiceClient{
|
|
c: thrift.NewTStandardClient(iprot, oprot),
|
|
}
|
|
}
|
|
|
|
func NewPushServiceClient(c thrift.TClient) *PushServiceClient {
|
|
return &PushServiceClient{
|
|
c: c,
|
|
}
|
|
}
|
|
|
|
func (p *PushServiceClient) Client_() thrift.TClient {
|
|
return p.c
|
|
}
|
|
|
|
func (p *PushServiceClient) Push(ctx context.Context, req *PushReq) (r *Resp, err error) {
|
|
var _args PushServicePushArgs
|
|
_args.Req = req
|
|
var _result PushServicePushResult
|
|
if err = p.Client_().Call(ctx, "Push", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
func (p *PushServiceClient) Add(ctx context.Context, req *config.PusherConfig) (r *Resp, err error) {
|
|
var _args PushServiceAddArgs
|
|
_args.Req = req
|
|
var _result PushServiceAddResult
|
|
if err = p.Client_().Call(ctx, "Add", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
func (p *PushServiceClient) List(ctx context.Context, req *ListPusherRequest) (r *ListPusherResponse, err error) {
|
|
var _args PushServiceListArgs
|
|
_args.Req = req
|
|
var _result PushServiceListResult
|
|
if err = p.Client_().Call(ctx, "List", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
func (p *PushServiceClient) GetPusherOptions(ctx context.Context) (r *GetPusherOptionsResponse, err error) {
|
|
var _args PushServiceGetPusherOptionsArgs
|
|
var _result PushServiceGetPusherOptionsResult
|
|
if err = p.Client_().Call(ctx, "GetPusherOptions", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
|
|
type PushServiceProcessor struct {
|
|
processorMap map[string]thrift.TProcessorFunction
|
|
handler PushService
|
|
}
|
|
|
|
func (p *PushServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
|
|
p.processorMap[key] = processor
|
|
}
|
|
|
|
func (p *PushServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
|
|
processor, ok = p.processorMap[key]
|
|
return processor, ok
|
|
}
|
|
|
|
func (p *PushServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
|
|
return p.processorMap
|
|
}
|
|
|
|
func NewPushServiceProcessor(handler PushService) *PushServiceProcessor {
|
|
self := &PushServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
|
|
self.AddToProcessorMap("Push", &pushServiceProcessorPush{handler: handler})
|
|
self.AddToProcessorMap("Add", &pushServiceProcessorAdd{handler: handler})
|
|
self.AddToProcessorMap("List", &pushServiceProcessorList{handler: handler})
|
|
self.AddToProcessorMap("GetPusherOptions", &pushServiceProcessorGetPusherOptions{handler: handler})
|
|
return self
|
|
}
|
|
func (p *PushServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
name, _, seqId, err := iprot.ReadMessageBegin()
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
if processor, ok := p.GetProcessorFunction(name); ok {
|
|
return processor.Process(ctx, seqId, iprot, oprot)
|
|
}
|
|
iprot.Skip(thrift.STRUCT)
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
|
|
oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, x
|
|
}
|
|
|
|
type pushServiceProcessorPush struct {
|
|
handler PushService
|
|
}
|
|
|
|
func (p *pushServiceProcessorPush) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := PushServicePushArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("Push", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := PushServicePushResult{}
|
|
var retval *Resp
|
|
if retval, err2 = p.handler.Push(ctx, args.Req); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Push: "+err2.Error())
|
|
oprot.WriteMessageBegin("Push", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("Push", thrift.REPLY, seqId); err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err != nil {
|
|
return
|
|
}
|
|
return true, err
|
|
}
|
|
|
|
type pushServiceProcessorAdd struct {
|
|
handler PushService
|
|
}
|
|
|
|
func (p *pushServiceProcessorAdd) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := PushServiceAddArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("Add", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := PushServiceAddResult{}
|
|
var retval *Resp
|
|
if retval, err2 = p.handler.Add(ctx, args.Req); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Add: "+err2.Error())
|
|
oprot.WriteMessageBegin("Add", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("Add", thrift.REPLY, seqId); err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err != nil {
|
|
return
|
|
}
|
|
return true, err
|
|
}
|
|
|
|
type pushServiceProcessorList struct {
|
|
handler PushService
|
|
}
|
|
|
|
func (p *pushServiceProcessorList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := PushServiceListArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("List", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := PushServiceListResult{}
|
|
var retval *ListPusherResponse
|
|
if retval, err2 = p.handler.List(ctx, args.Req); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing List: "+err2.Error())
|
|
oprot.WriteMessageBegin("List", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("List", thrift.REPLY, seqId); err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err != nil {
|
|
return
|
|
}
|
|
return true, err
|
|
}
|
|
|
|
type pushServiceProcessorGetPusherOptions struct {
|
|
handler PushService
|
|
}
|
|
|
|
func (p *pushServiceProcessorGetPusherOptions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := PushServiceGetPusherOptionsArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("GetPusherOptions", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := PushServiceGetPusherOptionsResult{}
|
|
var retval *GetPusherOptionsResponse
|
|
if retval, err2 = p.handler.GetPusherOptions(ctx); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPusherOptions: "+err2.Error())
|
|
oprot.WriteMessageBegin("GetPusherOptions", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("GetPusherOptions", thrift.REPLY, seqId); err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
err = err2
|
|
}
|
|
if err != nil {
|
|
return
|
|
}
|
|
return true, err
|
|
}
|
|
|
|
type PushServicePushArgs struct {
|
|
Req *PushReq `thrift:"req,1" frugal:"1,default,PushReq" json:"req"`
|
|
}
|
|
|
|
func NewPushServicePushArgs() *PushServicePushArgs {
|
|
return &PushServicePushArgs{}
|
|
}
|
|
|
|
func (p *PushServicePushArgs) InitDefault() {
|
|
}
|
|
|
|
var PushServicePushArgs_Req_DEFAULT *PushReq
|
|
|
|
func (p *PushServicePushArgs) GetReq() (v *PushReq) {
|
|
if !p.IsSetReq() {
|
|
return PushServicePushArgs_Req_DEFAULT
|
|
}
|
|
return p.Req
|
|
}
|
|
func (p *PushServicePushArgs) SetReq(val *PushReq) {
|
|
p.Req = val
|
|
}
|
|
|
|
var fieldIDToName_PushServicePushArgs = map[int16]string{
|
|
1: "req",
|
|
}
|
|
|
|
func (p *PushServicePushArgs) IsSetReq() bool {
|
|
return p.Req != nil
|
|
}
|
|
|
|
func (p *PushServicePushArgs) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.STRUCT {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServicePushArgs[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServicePushArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
_field := NewPushReq()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Req = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushServicePushArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("Push_args"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServicePushArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Req.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServicePushArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServicePushArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServicePushArgs) DeepEqual(ano *PushServicePushArgs) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Req) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushServicePushArgs) Field1DeepEqual(src *PushReq) bool {
|
|
|
|
if !p.Req.DeepEqual(src) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushServicePushResult struct {
|
|
Success *Resp `thrift:"success,0,optional" frugal:"0,optional,Resp" json:"success,omitempty"`
|
|
}
|
|
|
|
func NewPushServicePushResult() *PushServicePushResult {
|
|
return &PushServicePushResult{}
|
|
}
|
|
|
|
func (p *PushServicePushResult) InitDefault() {
|
|
}
|
|
|
|
var PushServicePushResult_Success_DEFAULT *Resp
|
|
|
|
func (p *PushServicePushResult) GetSuccess() (v *Resp) {
|
|
if !p.IsSetSuccess() {
|
|
return PushServicePushResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
func (p *PushServicePushResult) SetSuccess(x interface{}) {
|
|
p.Success = x.(*Resp)
|
|
}
|
|
|
|
var fieldIDToName_PushServicePushResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *PushServicePushResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *PushServicePushResult) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 0:
|
|
if fieldTypeId == thrift.STRUCT {
|
|
if err = p.ReadField0(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServicePushResult[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServicePushResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewResp()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushServicePushResult) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("Push_result"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField0(oprot); err != nil {
|
|
fieldId = 0
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServicePushResult) writeField0(oprot thrift.TProtocol) (err error) {
|
|
if p.IsSetSuccess() {
|
|
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Success.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServicePushResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServicePushResult(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServicePushResult) DeepEqual(ano *PushServicePushResult) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field0DeepEqual(ano.Success) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushServicePushResult) Field0DeepEqual(src *Resp) bool {
|
|
|
|
if !p.Success.DeepEqual(src) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushServiceAddArgs struct {
|
|
Req *config.PusherConfig `thrift:"req,1" frugal:"1,default,config.PusherConfig" json:"req"`
|
|
}
|
|
|
|
func NewPushServiceAddArgs() *PushServiceAddArgs {
|
|
return &PushServiceAddArgs{}
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) InitDefault() {
|
|
}
|
|
|
|
var PushServiceAddArgs_Req_DEFAULT *config.PusherConfig
|
|
|
|
func (p *PushServiceAddArgs) GetReq() (v *config.PusherConfig) {
|
|
if !p.IsSetReq() {
|
|
return PushServiceAddArgs_Req_DEFAULT
|
|
}
|
|
return p.Req
|
|
}
|
|
func (p *PushServiceAddArgs) SetReq(val *config.PusherConfig) {
|
|
p.Req = val
|
|
}
|
|
|
|
var fieldIDToName_PushServiceAddArgs = map[int16]string{
|
|
1: "req",
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) IsSetReq() bool {
|
|
return p.Req != nil
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.STRUCT {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceAddArgs[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
_field := config.NewPusherConfig()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Req = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("Add_args"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Req.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServiceAddArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) DeepEqual(ano *PushServiceAddArgs) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Req) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushServiceAddArgs) Field1DeepEqual(src *config.PusherConfig) bool {
|
|
|
|
if !p.Req.DeepEqual(src) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushServiceAddResult struct {
|
|
Success *Resp `thrift:"success,0,optional" frugal:"0,optional,Resp" json:"success,omitempty"`
|
|
}
|
|
|
|
func NewPushServiceAddResult() *PushServiceAddResult {
|
|
return &PushServiceAddResult{}
|
|
}
|
|
|
|
func (p *PushServiceAddResult) InitDefault() {
|
|
}
|
|
|
|
var PushServiceAddResult_Success_DEFAULT *Resp
|
|
|
|
func (p *PushServiceAddResult) GetSuccess() (v *Resp) {
|
|
if !p.IsSetSuccess() {
|
|
return PushServiceAddResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
func (p *PushServiceAddResult) SetSuccess(x interface{}) {
|
|
p.Success = x.(*Resp)
|
|
}
|
|
|
|
var fieldIDToName_PushServiceAddResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *PushServiceAddResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *PushServiceAddResult) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 0:
|
|
if fieldTypeId == thrift.STRUCT {
|
|
if err = p.ReadField0(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceAddResult[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceAddResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewResp()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushServiceAddResult) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("Add_result"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField0(oprot); err != nil {
|
|
fieldId = 0
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceAddResult) writeField0(oprot thrift.TProtocol) (err error) {
|
|
if p.IsSetSuccess() {
|
|
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Success.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceAddResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServiceAddResult(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServiceAddResult) DeepEqual(ano *PushServiceAddResult) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field0DeepEqual(ano.Success) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushServiceAddResult) Field0DeepEqual(src *Resp) bool {
|
|
|
|
if !p.Success.DeepEqual(src) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushServiceListArgs struct {
|
|
Req *ListPusherRequest `thrift:"req,1" frugal:"1,default,ListPusherRequest" json:"req"`
|
|
}
|
|
|
|
func NewPushServiceListArgs() *PushServiceListArgs {
|
|
return &PushServiceListArgs{}
|
|
}
|
|
|
|
func (p *PushServiceListArgs) InitDefault() {
|
|
}
|
|
|
|
var PushServiceListArgs_Req_DEFAULT *ListPusherRequest
|
|
|
|
func (p *PushServiceListArgs) GetReq() (v *ListPusherRequest) {
|
|
if !p.IsSetReq() {
|
|
return PushServiceListArgs_Req_DEFAULT
|
|
}
|
|
return p.Req
|
|
}
|
|
func (p *PushServiceListArgs) SetReq(val *ListPusherRequest) {
|
|
p.Req = val
|
|
}
|
|
|
|
var fieldIDToName_PushServiceListArgs = map[int16]string{
|
|
1: "req",
|
|
}
|
|
|
|
func (p *PushServiceListArgs) IsSetReq() bool {
|
|
return p.Req != nil
|
|
}
|
|
|
|
func (p *PushServiceListArgs) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 1:
|
|
if fieldTypeId == thrift.STRUCT {
|
|
if err = p.ReadField1(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceListArgs[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceListArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
_field := NewListPusherRequest()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Req = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushServiceListArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("List_args"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField1(oprot); err != nil {
|
|
fieldId = 1
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceListArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Req.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceListArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServiceListArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServiceListArgs) DeepEqual(ano *PushServiceListArgs) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field1DeepEqual(ano.Req) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushServiceListArgs) Field1DeepEqual(src *ListPusherRequest) bool {
|
|
|
|
if !p.Req.DeepEqual(src) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushServiceListResult struct {
|
|
Success *ListPusherResponse `thrift:"success,0,optional" frugal:"0,optional,ListPusherResponse" json:"success,omitempty"`
|
|
}
|
|
|
|
func NewPushServiceListResult() *PushServiceListResult {
|
|
return &PushServiceListResult{}
|
|
}
|
|
|
|
func (p *PushServiceListResult) InitDefault() {
|
|
}
|
|
|
|
var PushServiceListResult_Success_DEFAULT *ListPusherResponse
|
|
|
|
func (p *PushServiceListResult) GetSuccess() (v *ListPusherResponse) {
|
|
if !p.IsSetSuccess() {
|
|
return PushServiceListResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
func (p *PushServiceListResult) SetSuccess(x interface{}) {
|
|
p.Success = x.(*ListPusherResponse)
|
|
}
|
|
|
|
var fieldIDToName_PushServiceListResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *PushServiceListResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *PushServiceListResult) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 0:
|
|
if fieldTypeId == thrift.STRUCT {
|
|
if err = p.ReadField0(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceListResult[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceListResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewListPusherResponse()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushServiceListResult) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("List_result"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField0(oprot); err != nil {
|
|
fieldId = 0
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceListResult) writeField0(oprot thrift.TProtocol) (err error) {
|
|
if p.IsSetSuccess() {
|
|
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Success.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceListResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServiceListResult(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServiceListResult) DeepEqual(ano *PushServiceListResult) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field0DeepEqual(ano.Success) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushServiceListResult) Field0DeepEqual(src *ListPusherResponse) bool {
|
|
|
|
if !p.Success.DeepEqual(src) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushServiceGetPusherOptionsArgs struct {
|
|
}
|
|
|
|
func NewPushServiceGetPusherOptionsArgs() *PushServiceGetPusherOptionsArgs {
|
|
return &PushServiceGetPusherOptionsArgs{}
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) InitDefault() {
|
|
}
|
|
|
|
var fieldIDToName_PushServiceGetPusherOptionsArgs = map[int16]string{}
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldTypeError
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
SkipFieldTypeError:
|
|
return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
if err = oprot.WriteStructBegin("GetPusherOptions_args"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServiceGetPusherOptionsArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsArgs) DeepEqual(ano *PushServiceGetPusherOptionsArgs) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
type PushServiceGetPusherOptionsResult struct {
|
|
Success *GetPusherOptionsResponse `thrift:"success,0,optional" frugal:"0,optional,GetPusherOptionsResponse" json:"success,omitempty"`
|
|
}
|
|
|
|
func NewPushServiceGetPusherOptionsResult() *PushServiceGetPusherOptionsResult {
|
|
return &PushServiceGetPusherOptionsResult{}
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) InitDefault() {
|
|
}
|
|
|
|
var PushServiceGetPusherOptionsResult_Success_DEFAULT *GetPusherOptionsResponse
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) GetSuccess() (v *GetPusherOptionsResponse) {
|
|
if !p.IsSetSuccess() {
|
|
return PushServiceGetPusherOptionsResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
func (p *PushServiceGetPusherOptionsResult) SetSuccess(x interface{}) {
|
|
p.Success = x.(*GetPusherOptionsResponse)
|
|
}
|
|
|
|
var fieldIDToName_PushServiceGetPusherOptionsResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) Read(iprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldTypeId thrift.TType
|
|
var fieldId int16
|
|
|
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
goto ReadStructBeginError
|
|
}
|
|
|
|
for {
|
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
if err != nil {
|
|
goto ReadFieldBeginError
|
|
}
|
|
if fieldTypeId == thrift.STOP {
|
|
break
|
|
}
|
|
|
|
switch fieldId {
|
|
case 0:
|
|
if fieldTypeId == thrift.STRUCT {
|
|
if err = p.ReadField0(iprot); err != nil {
|
|
goto ReadFieldError
|
|
}
|
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
default:
|
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
goto SkipFieldError
|
|
}
|
|
}
|
|
if err = iprot.ReadFieldEnd(); err != nil {
|
|
goto ReadFieldEndError
|
|
}
|
|
}
|
|
if err = iprot.ReadStructEnd(); err != nil {
|
|
goto ReadStructEndError
|
|
}
|
|
|
|
return nil
|
|
ReadStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
ReadFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
ReadFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PushServiceGetPusherOptionsResult[fieldId]), err)
|
|
SkipFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
|
|
ReadFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
ReadStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewGetPusherOptionsResponse()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) Write(oprot thrift.TProtocol) (err error) {
|
|
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("GetPusherOptions_result"); err != nil {
|
|
goto WriteStructBeginError
|
|
}
|
|
if p != nil {
|
|
if err = p.writeField0(oprot); err != nil {
|
|
fieldId = 0
|
|
goto WriteFieldError
|
|
}
|
|
}
|
|
if err = oprot.WriteFieldStop(); err != nil {
|
|
goto WriteFieldStopError
|
|
}
|
|
if err = oprot.WriteStructEnd(); err != nil {
|
|
goto WriteStructEndError
|
|
}
|
|
return nil
|
|
WriteStructBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
WriteFieldError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
WriteFieldStopError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
WriteStructEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) writeField0(oprot thrift.TProtocol) (err error) {
|
|
if p.IsSetSuccess() {
|
|
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Success.Write(oprot); err != nil {
|
|
return err
|
|
}
|
|
if err = oprot.WriteFieldEnd(); err != nil {
|
|
goto WriteFieldEndError
|
|
}
|
|
}
|
|
return nil
|
|
WriteFieldBeginError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
|
WriteFieldEndError:
|
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("PushServiceGetPusherOptionsResult(%+v)", *p)
|
|
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) DeepEqual(ano *PushServiceGetPusherOptionsResult) bool {
|
|
if p == ano {
|
|
return true
|
|
} else if p == nil || ano == nil {
|
|
return false
|
|
}
|
|
if !p.Field0DeepEqual(ano.Success) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (p *PushServiceGetPusherOptionsResult) Field0DeepEqual(src *GetPusherOptionsResponse) bool {
|
|
|
|
if !p.Success.DeepEqual(src) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|