2902 lines
78 KiB
Go
2902 lines
78 KiB
Go
// Code generated by thriftgo (0.4.2). DO NOT EDIT.
|
|
|
|
package audioandvideocalls
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
"database/sql/driver"
|
|
"fmt"
|
|
"github.com/apache/thrift/lib/go/thrift"
|
|
)
|
|
|
|
type Code int64
|
|
|
|
const (
|
|
Code_Success Code = 1
|
|
Code_ParamInvalid Code = 2
|
|
Code_DBErr Code = 3
|
|
Code_ServerError Code = 4
|
|
)
|
|
|
|
func (p Code) String() string {
|
|
switch p {
|
|
case Code_Success:
|
|
return "Success"
|
|
case Code_ParamInvalid:
|
|
return "ParamInvalid"
|
|
case Code_DBErr:
|
|
return "DBErr"
|
|
case Code_ServerError:
|
|
return "ServerError"
|
|
}
|
|
return "<UNSET>"
|
|
}
|
|
|
|
func CodeFromString(s string) (Code, error) {
|
|
switch s {
|
|
case "Success":
|
|
return Code_Success, nil
|
|
case "ParamInvalid":
|
|
return Code_ParamInvalid, nil
|
|
case "DBErr":
|
|
return Code_DBErr, nil
|
|
case "ServerError":
|
|
return Code_ServerError, nil
|
|
}
|
|
return Code(0), fmt.Errorf("not a valid Code string")
|
|
}
|
|
|
|
func CodePtr(v Code) *Code { return &v }
|
|
func (p *Code) Scan(value interface{}) (err error) {
|
|
var result sql.NullInt64
|
|
err = result.Scan(value)
|
|
*p = Code(result.Int64)
|
|
return
|
|
}
|
|
|
|
func (p *Code) Value() (driver.Value, error) {
|
|
if p == nil {
|
|
return nil, nil
|
|
}
|
|
return int64(*p), nil
|
|
}
|
|
|
|
type AudioCallReq struct {
|
|
UserID string `thrift:"user_id,1" form:"user_id" json:"user_id"`
|
|
TargetUserID string `thrift:"target_user_id,2" form:"target_user_id" json:"target_user_id"`
|
|
}
|
|
|
|
func NewAudioCallReq() *AudioCallReq {
|
|
return &AudioCallReq{}
|
|
}
|
|
|
|
func (p *AudioCallReq) InitDefault() {
|
|
}
|
|
|
|
func (p *AudioCallReq) GetUserID() (v string) {
|
|
return p.UserID
|
|
}
|
|
|
|
func (p *AudioCallReq) GetTargetUserID() (v string) {
|
|
return p.TargetUserID
|
|
}
|
|
|
|
var fieldIDToName_AudioCallReq = map[int16]string{
|
|
1: "user_id",
|
|
2: "target_user_id",
|
|
}
|
|
|
|
func (p *AudioCallReq) 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.STRING {
|
|
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_AudioCallReq[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 *AudioCallReq) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.UserID = _field
|
|
return nil
|
|
}
|
|
func (p *AudioCallReq) ReadField2(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.TargetUserID = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *AudioCallReq) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("audioCallReq"); 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 *AudioCallReq) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("user_id", thrift.STRING, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.UserID); 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 *AudioCallReq) writeField2(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("target_user_id", thrift.STRING, 2); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.TargetUserID); 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 *AudioCallReq) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("AudioCallReq(%+v)", *p)
|
|
|
|
}
|
|
|
|
type AudioCallResp struct {
|
|
Code Code `thrift:"code,1" form:"code" json:"code" query:"code"`
|
|
Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"`
|
|
}
|
|
|
|
func NewAudioCallResp() *AudioCallResp {
|
|
return &AudioCallResp{}
|
|
}
|
|
|
|
func (p *AudioCallResp) InitDefault() {
|
|
}
|
|
|
|
func (p *AudioCallResp) GetCode() (v Code) {
|
|
return p.Code
|
|
}
|
|
|
|
func (p *AudioCallResp) GetMsg() (v string) {
|
|
return p.Msg
|
|
}
|
|
|
|
var fieldIDToName_AudioCallResp = map[int16]string{
|
|
1: "code",
|
|
2: "msg",
|
|
}
|
|
|
|
func (p *AudioCallResp) 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.I32 {
|
|
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
|
|
}
|
|
} 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_AudioCallResp[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 *AudioCallResp) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field Code
|
|
if v, err := iprot.ReadI32(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = Code(v)
|
|
}
|
|
p.Code = _field
|
|
return nil
|
|
}
|
|
func (p *AudioCallResp) 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 *AudioCallResp) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("audioCallResp"); 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 *AudioCallResp) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteI32(int32(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 *AudioCallResp) 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 *AudioCallResp) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("AudioCallResp(%+v)", *p)
|
|
|
|
}
|
|
|
|
type VideoCallReq struct {
|
|
UserID string `thrift:"user_id,1" form:"user_id" json:"user_id"`
|
|
TargetUserID string `thrift:"target_user_id,2" form:"target_user_id" json:"target_user_id"`
|
|
}
|
|
|
|
func NewVideoCallReq() *VideoCallReq {
|
|
return &VideoCallReq{}
|
|
}
|
|
|
|
func (p *VideoCallReq) InitDefault() {
|
|
}
|
|
|
|
func (p *VideoCallReq) GetUserID() (v string) {
|
|
return p.UserID
|
|
}
|
|
|
|
func (p *VideoCallReq) GetTargetUserID() (v string) {
|
|
return p.TargetUserID
|
|
}
|
|
|
|
var fieldIDToName_VideoCallReq = map[int16]string{
|
|
1: "user_id",
|
|
2: "target_user_id",
|
|
}
|
|
|
|
func (p *VideoCallReq) 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.STRING {
|
|
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_VideoCallReq[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 *VideoCallReq) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.UserID = _field
|
|
return nil
|
|
}
|
|
func (p *VideoCallReq) ReadField2(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.TargetUserID = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *VideoCallReq) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("videoCallReq"); 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 *VideoCallReq) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("user_id", thrift.STRING, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.UserID); 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 *VideoCallReq) writeField2(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("target_user_id", thrift.STRING, 2); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.TargetUserID); 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 *VideoCallReq) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("VideoCallReq(%+v)", *p)
|
|
|
|
}
|
|
|
|
type VideoCallResp struct {
|
|
Code Code `thrift:"code,1" form:"code" json:"code" query:"code"`
|
|
Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"`
|
|
}
|
|
|
|
func NewVideoCallResp() *VideoCallResp {
|
|
return &VideoCallResp{}
|
|
}
|
|
|
|
func (p *VideoCallResp) InitDefault() {
|
|
}
|
|
|
|
func (p *VideoCallResp) GetCode() (v Code) {
|
|
return p.Code
|
|
}
|
|
|
|
func (p *VideoCallResp) GetMsg() (v string) {
|
|
return p.Msg
|
|
}
|
|
|
|
var fieldIDToName_VideoCallResp = map[int16]string{
|
|
1: "code",
|
|
2: "msg",
|
|
}
|
|
|
|
func (p *VideoCallResp) 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.I32 {
|
|
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
|
|
}
|
|
} 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_VideoCallResp[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 *VideoCallResp) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field Code
|
|
if v, err := iprot.ReadI32(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = Code(v)
|
|
}
|
|
p.Code = _field
|
|
return nil
|
|
}
|
|
func (p *VideoCallResp) 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 *VideoCallResp) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("videoCallResp"); 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 *VideoCallResp) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteI32(int32(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 *VideoCallResp) 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 *VideoCallResp) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("VideoCallResp(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RoomListReq struct {
|
|
}
|
|
|
|
func NewRoomListReq() *RoomListReq {
|
|
return &RoomListReq{}
|
|
}
|
|
|
|
func (p *RoomListReq) InitDefault() {
|
|
}
|
|
|
|
var fieldIDToName_RoomListReq = map[int16]string{}
|
|
|
|
func (p *RoomListReq) 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 *RoomListReq) Write(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteStructBegin("roomListReq"); 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 *RoomListReq) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RoomListReq(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RoomListResp struct {
|
|
}
|
|
|
|
func NewRoomListResp() *RoomListResp {
|
|
return &RoomListResp{}
|
|
}
|
|
|
|
func (p *RoomListResp) InitDefault() {
|
|
}
|
|
|
|
var fieldIDToName_RoomListResp = map[int16]string{}
|
|
|
|
func (p *RoomListResp) 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 *RoomListResp) Write(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteStructBegin("roomListResp"); 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 *RoomListResp) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RoomListResp(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RemoveRoomReq struct {
|
|
RoomID string `thrift:"room_id,1" form:"room_id" json:"room_id"`
|
|
}
|
|
|
|
func NewRemoveRoomReq() *RemoveRoomReq {
|
|
return &RemoveRoomReq{}
|
|
}
|
|
|
|
func (p *RemoveRoomReq) InitDefault() {
|
|
}
|
|
|
|
func (p *RemoveRoomReq) GetRoomID() (v string) {
|
|
return p.RoomID
|
|
}
|
|
|
|
var fieldIDToName_RemoveRoomReq = map[int16]string{
|
|
1: "room_id",
|
|
}
|
|
|
|
func (p *RemoveRoomReq) 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
|
|
}
|
|
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_RemoveRoomReq[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 *RemoveRoomReq) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field string
|
|
if v, err := iprot.ReadString(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = v
|
|
}
|
|
p.RoomID = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *RemoveRoomReq) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("RemoveRoomReq"); 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 *RemoveRoomReq) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("room_id", thrift.STRING, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteString(p.RoomID); 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 *RemoveRoomReq) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RemoveRoomReq(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RemoveRoomResp struct {
|
|
Code Code `thrift:"code,1" form:"code" json:"code" query:"code"`
|
|
Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"`
|
|
}
|
|
|
|
func NewRemoveRoomResp() *RemoveRoomResp {
|
|
return &RemoveRoomResp{}
|
|
}
|
|
|
|
func (p *RemoveRoomResp) InitDefault() {
|
|
}
|
|
|
|
func (p *RemoveRoomResp) GetCode() (v Code) {
|
|
return p.Code
|
|
}
|
|
|
|
func (p *RemoveRoomResp) GetMsg() (v string) {
|
|
return p.Msg
|
|
}
|
|
|
|
var fieldIDToName_RemoveRoomResp = map[int16]string{
|
|
1: "code",
|
|
2: "msg",
|
|
}
|
|
|
|
func (p *RemoveRoomResp) 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.I32 {
|
|
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
|
|
}
|
|
} 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_RemoveRoomResp[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 *RemoveRoomResp) ReadField1(iprot thrift.TProtocol) error {
|
|
|
|
var _field Code
|
|
if v, err := iprot.ReadI32(); err != nil {
|
|
return err
|
|
} else {
|
|
_field = Code(v)
|
|
}
|
|
p.Code = _field
|
|
return nil
|
|
}
|
|
func (p *RemoveRoomResp) 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 *RemoveRoomResp) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("RemoveRoomResp"); 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 *RemoveRoomResp) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := oprot.WriteI32(int32(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 *RemoveRoomResp) 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 *RemoveRoomResp) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RemoveRoomResp(%+v)", *p)
|
|
|
|
}
|
|
|
|
type AudioCallService interface {
|
|
AudioCall(ctx context.Context, request *AudioCallReq) (r *AudioCallResp, err error)
|
|
}
|
|
|
|
type AudioCallServiceClient struct {
|
|
c thrift.TClient
|
|
}
|
|
|
|
func NewAudioCallServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AudioCallServiceClient {
|
|
return &AudioCallServiceClient{
|
|
c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
|
|
}
|
|
}
|
|
|
|
func NewAudioCallServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AudioCallServiceClient {
|
|
return &AudioCallServiceClient{
|
|
c: thrift.NewTStandardClient(iprot, oprot),
|
|
}
|
|
}
|
|
|
|
func NewAudioCallServiceClient(c thrift.TClient) *AudioCallServiceClient {
|
|
return &AudioCallServiceClient{
|
|
c: c,
|
|
}
|
|
}
|
|
|
|
func (p *AudioCallServiceClient) Client_() thrift.TClient {
|
|
return p.c
|
|
}
|
|
|
|
func (p *AudioCallServiceClient) AudioCall(ctx context.Context, request *AudioCallReq) (r *AudioCallResp, err error) {
|
|
var _args AudioCallServiceAudioCallArgs
|
|
_args.Request = request
|
|
var _result AudioCallServiceAudioCallResult
|
|
if err = p.Client_().Call(ctx, "audioCall", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
|
|
type VideoCallService interface {
|
|
VideoCall(ctx context.Context, request *VideoCallReq) (r *VideoCallResp, err error)
|
|
}
|
|
|
|
type VideoCallServiceClient struct {
|
|
c thrift.TClient
|
|
}
|
|
|
|
func NewVideoCallServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *VideoCallServiceClient {
|
|
return &VideoCallServiceClient{
|
|
c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
|
|
}
|
|
}
|
|
|
|
func NewVideoCallServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *VideoCallServiceClient {
|
|
return &VideoCallServiceClient{
|
|
c: thrift.NewTStandardClient(iprot, oprot),
|
|
}
|
|
}
|
|
|
|
func NewVideoCallServiceClient(c thrift.TClient) *VideoCallServiceClient {
|
|
return &VideoCallServiceClient{
|
|
c: c,
|
|
}
|
|
}
|
|
|
|
func (p *VideoCallServiceClient) Client_() thrift.TClient {
|
|
return p.c
|
|
}
|
|
|
|
func (p *VideoCallServiceClient) VideoCall(ctx context.Context, request *VideoCallReq) (r *VideoCallResp, err error) {
|
|
var _args VideoCallServiceVideoCallArgs
|
|
_args.Request = request
|
|
var _result VideoCallServiceVideoCallResult
|
|
if err = p.Client_().Call(ctx, "videoCall", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
|
|
type RoomService interface {
|
|
RoomList(ctx context.Context, request *RoomListReq) (r *RoomListResp, err error)
|
|
|
|
RoomRemove(ctx context.Context, request *RemoveRoomReq) (r *RemoveRoomResp, err error)
|
|
}
|
|
|
|
type RoomServiceClient struct {
|
|
c thrift.TClient
|
|
}
|
|
|
|
func NewRoomServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *RoomServiceClient {
|
|
return &RoomServiceClient{
|
|
c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
|
|
}
|
|
}
|
|
|
|
func NewRoomServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *RoomServiceClient {
|
|
return &RoomServiceClient{
|
|
c: thrift.NewTStandardClient(iprot, oprot),
|
|
}
|
|
}
|
|
|
|
func NewRoomServiceClient(c thrift.TClient) *RoomServiceClient {
|
|
return &RoomServiceClient{
|
|
c: c,
|
|
}
|
|
}
|
|
|
|
func (p *RoomServiceClient) Client_() thrift.TClient {
|
|
return p.c
|
|
}
|
|
|
|
func (p *RoomServiceClient) RoomList(ctx context.Context, request *RoomListReq) (r *RoomListResp, err error) {
|
|
var _args RoomServiceRoomListArgs
|
|
_args.Request = request
|
|
var _result RoomServiceRoomListResult
|
|
if err = p.Client_().Call(ctx, "RoomList", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
func (p *RoomServiceClient) RoomRemove(ctx context.Context, request *RemoveRoomReq) (r *RemoveRoomResp, err error) {
|
|
var _args RoomServiceRoomRemoveArgs
|
|
_args.Request = request
|
|
var _result RoomServiceRoomRemoveResult
|
|
if err = p.Client_().Call(ctx, "RoomRemove", &_args, &_result); err != nil {
|
|
return
|
|
}
|
|
return _result.GetSuccess(), nil
|
|
}
|
|
|
|
type AudioCallServiceProcessor struct {
|
|
processorMap map[string]thrift.TProcessorFunction
|
|
handler AudioCallService
|
|
}
|
|
|
|
func (p *AudioCallServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
|
|
p.processorMap[key] = processor
|
|
}
|
|
|
|
func (p *AudioCallServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
|
|
processor, ok = p.processorMap[key]
|
|
return processor, ok
|
|
}
|
|
|
|
func (p *AudioCallServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
|
|
return p.processorMap
|
|
}
|
|
|
|
func NewAudioCallServiceProcessor(handler AudioCallService) *AudioCallServiceProcessor {
|
|
self := &AudioCallServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
|
|
self.AddToProcessorMap("audioCall", &audioCallServiceProcessorAudioCall{handler: handler})
|
|
return self
|
|
}
|
|
func (p *AudioCallServiceProcessor) 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 audioCallServiceProcessorAudioCall struct {
|
|
handler AudioCallService
|
|
}
|
|
|
|
func (p *audioCallServiceProcessorAudioCall) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := AudioCallServiceAudioCallArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("audioCall", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := AudioCallServiceAudioCallResult{}
|
|
var retval *AudioCallResp
|
|
if retval, err2 = p.handler.AudioCall(ctx, args.Request); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing audioCall: "+err2.Error())
|
|
oprot.WriteMessageBegin("audioCall", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("audioCall", 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 AudioCallServiceAudioCallArgs struct {
|
|
Request *AudioCallReq `thrift:"request,1"`
|
|
}
|
|
|
|
func NewAudioCallServiceAudioCallArgs() *AudioCallServiceAudioCallArgs {
|
|
return &AudioCallServiceAudioCallArgs{}
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallArgs) InitDefault() {
|
|
}
|
|
|
|
var AudioCallServiceAudioCallArgs_Request_DEFAULT *AudioCallReq
|
|
|
|
func (p *AudioCallServiceAudioCallArgs) GetRequest() (v *AudioCallReq) {
|
|
if !p.IsSetRequest() {
|
|
return AudioCallServiceAudioCallArgs_Request_DEFAULT
|
|
}
|
|
return p.Request
|
|
}
|
|
|
|
var fieldIDToName_AudioCallServiceAudioCallArgs = map[int16]string{
|
|
1: "request",
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallArgs) IsSetRequest() bool {
|
|
return p.Request != nil
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallArgs) 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_AudioCallServiceAudioCallArgs[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 *AudioCallServiceAudioCallArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
_field := NewAudioCallReq()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Request = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("audioCall_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 *AudioCallServiceAudioCallArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Request.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 *AudioCallServiceAudioCallArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("AudioCallServiceAudioCallArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
type AudioCallServiceAudioCallResult struct {
|
|
Success *AudioCallResp `thrift:"success,0,optional"`
|
|
}
|
|
|
|
func NewAudioCallServiceAudioCallResult() *AudioCallServiceAudioCallResult {
|
|
return &AudioCallServiceAudioCallResult{}
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallResult) InitDefault() {
|
|
}
|
|
|
|
var AudioCallServiceAudioCallResult_Success_DEFAULT *AudioCallResp
|
|
|
|
func (p *AudioCallServiceAudioCallResult) GetSuccess() (v *AudioCallResp) {
|
|
if !p.IsSetSuccess() {
|
|
return AudioCallServiceAudioCallResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
|
|
var fieldIDToName_AudioCallServiceAudioCallResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallResult) 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_AudioCallServiceAudioCallResult[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 *AudioCallServiceAudioCallResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewAudioCallResp()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *AudioCallServiceAudioCallResult) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("audioCall_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 *AudioCallServiceAudioCallResult) 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 *AudioCallServiceAudioCallResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("AudioCallServiceAudioCallResult(%+v)", *p)
|
|
|
|
}
|
|
|
|
type VideoCallServiceProcessor struct {
|
|
processorMap map[string]thrift.TProcessorFunction
|
|
handler VideoCallService
|
|
}
|
|
|
|
func (p *VideoCallServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
|
|
p.processorMap[key] = processor
|
|
}
|
|
|
|
func (p *VideoCallServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
|
|
processor, ok = p.processorMap[key]
|
|
return processor, ok
|
|
}
|
|
|
|
func (p *VideoCallServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
|
|
return p.processorMap
|
|
}
|
|
|
|
func NewVideoCallServiceProcessor(handler VideoCallService) *VideoCallServiceProcessor {
|
|
self := &VideoCallServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
|
|
self.AddToProcessorMap("videoCall", &videoCallServiceProcessorVideoCall{handler: handler})
|
|
return self
|
|
}
|
|
func (p *VideoCallServiceProcessor) 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 videoCallServiceProcessorVideoCall struct {
|
|
handler VideoCallService
|
|
}
|
|
|
|
func (p *videoCallServiceProcessorVideoCall) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := VideoCallServiceVideoCallArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("videoCall", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := VideoCallServiceVideoCallResult{}
|
|
var retval *VideoCallResp
|
|
if retval, err2 = p.handler.VideoCall(ctx, args.Request); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing videoCall: "+err2.Error())
|
|
oprot.WriteMessageBegin("videoCall", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("videoCall", 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 VideoCallServiceVideoCallArgs struct {
|
|
Request *VideoCallReq `thrift:"request,1"`
|
|
}
|
|
|
|
func NewVideoCallServiceVideoCallArgs() *VideoCallServiceVideoCallArgs {
|
|
return &VideoCallServiceVideoCallArgs{}
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallArgs) InitDefault() {
|
|
}
|
|
|
|
var VideoCallServiceVideoCallArgs_Request_DEFAULT *VideoCallReq
|
|
|
|
func (p *VideoCallServiceVideoCallArgs) GetRequest() (v *VideoCallReq) {
|
|
if !p.IsSetRequest() {
|
|
return VideoCallServiceVideoCallArgs_Request_DEFAULT
|
|
}
|
|
return p.Request
|
|
}
|
|
|
|
var fieldIDToName_VideoCallServiceVideoCallArgs = map[int16]string{
|
|
1: "request",
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallArgs) IsSetRequest() bool {
|
|
return p.Request != nil
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallArgs) 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_VideoCallServiceVideoCallArgs[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 *VideoCallServiceVideoCallArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
_field := NewVideoCallReq()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Request = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("videoCall_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 *VideoCallServiceVideoCallArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Request.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 *VideoCallServiceVideoCallArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("VideoCallServiceVideoCallArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
type VideoCallServiceVideoCallResult struct {
|
|
Success *VideoCallResp `thrift:"success,0,optional"`
|
|
}
|
|
|
|
func NewVideoCallServiceVideoCallResult() *VideoCallServiceVideoCallResult {
|
|
return &VideoCallServiceVideoCallResult{}
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallResult) InitDefault() {
|
|
}
|
|
|
|
var VideoCallServiceVideoCallResult_Success_DEFAULT *VideoCallResp
|
|
|
|
func (p *VideoCallServiceVideoCallResult) GetSuccess() (v *VideoCallResp) {
|
|
if !p.IsSetSuccess() {
|
|
return VideoCallServiceVideoCallResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
|
|
var fieldIDToName_VideoCallServiceVideoCallResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallResult) 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_VideoCallServiceVideoCallResult[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 *VideoCallServiceVideoCallResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewVideoCallResp()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *VideoCallServiceVideoCallResult) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("videoCall_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 *VideoCallServiceVideoCallResult) 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 *VideoCallServiceVideoCallResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("VideoCallServiceVideoCallResult(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RoomServiceProcessor struct {
|
|
processorMap map[string]thrift.TProcessorFunction
|
|
handler RoomService
|
|
}
|
|
|
|
func (p *RoomServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
|
|
p.processorMap[key] = processor
|
|
}
|
|
|
|
func (p *RoomServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
|
|
processor, ok = p.processorMap[key]
|
|
return processor, ok
|
|
}
|
|
|
|
func (p *RoomServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
|
|
return p.processorMap
|
|
}
|
|
|
|
func NewRoomServiceProcessor(handler RoomService) *RoomServiceProcessor {
|
|
self := &RoomServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
|
|
self.AddToProcessorMap("RoomList", &roomServiceProcessorRoomList{handler: handler})
|
|
self.AddToProcessorMap("RoomRemove", &roomServiceProcessorRoomRemove{handler: handler})
|
|
return self
|
|
}
|
|
func (p *RoomServiceProcessor) 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 roomServiceProcessorRoomList struct {
|
|
handler RoomService
|
|
}
|
|
|
|
func (p *roomServiceProcessorRoomList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := RoomServiceRoomListArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("RoomList", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := RoomServiceRoomListResult{}
|
|
var retval *RoomListResp
|
|
if retval, err2 = p.handler.RoomList(ctx, args.Request); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RoomList: "+err2.Error())
|
|
oprot.WriteMessageBegin("RoomList", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("RoomList", 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 roomServiceProcessorRoomRemove struct {
|
|
handler RoomService
|
|
}
|
|
|
|
func (p *roomServiceProcessorRoomRemove) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
args := RoomServiceRoomRemoveArgs{}
|
|
if err = args.Read(iprot); err != nil {
|
|
iprot.ReadMessageEnd()
|
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
oprot.WriteMessageBegin("RoomRemove", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return false, err
|
|
}
|
|
|
|
iprot.ReadMessageEnd()
|
|
var err2 error
|
|
result := RoomServiceRoomRemoveResult{}
|
|
var retval *RemoveRoomResp
|
|
if retval, err2 = p.handler.RoomRemove(ctx, args.Request); err2 != nil {
|
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RoomRemove: "+err2.Error())
|
|
oprot.WriteMessageBegin("RoomRemove", thrift.EXCEPTION, seqId)
|
|
x.Write(oprot)
|
|
oprot.WriteMessageEnd()
|
|
oprot.Flush(ctx)
|
|
return true, err2
|
|
} else {
|
|
result.Success = retval
|
|
}
|
|
if err2 = oprot.WriteMessageBegin("RoomRemove", 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 RoomServiceRoomListArgs struct {
|
|
Request *RoomListReq `thrift:"request,1"`
|
|
}
|
|
|
|
func NewRoomServiceRoomListArgs() *RoomServiceRoomListArgs {
|
|
return &RoomServiceRoomListArgs{}
|
|
}
|
|
|
|
func (p *RoomServiceRoomListArgs) InitDefault() {
|
|
}
|
|
|
|
var RoomServiceRoomListArgs_Request_DEFAULT *RoomListReq
|
|
|
|
func (p *RoomServiceRoomListArgs) GetRequest() (v *RoomListReq) {
|
|
if !p.IsSetRequest() {
|
|
return RoomServiceRoomListArgs_Request_DEFAULT
|
|
}
|
|
return p.Request
|
|
}
|
|
|
|
var fieldIDToName_RoomServiceRoomListArgs = map[int16]string{
|
|
1: "request",
|
|
}
|
|
|
|
func (p *RoomServiceRoomListArgs) IsSetRequest() bool {
|
|
return p.Request != nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomListArgs) 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_RoomServiceRoomListArgs[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 *RoomServiceRoomListArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
_field := NewRoomListReq()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Request = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomListArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("RoomList_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 *RoomServiceRoomListArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Request.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 *RoomServiceRoomListArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RoomServiceRoomListArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RoomServiceRoomListResult struct {
|
|
Success *RoomListResp `thrift:"success,0,optional"`
|
|
}
|
|
|
|
func NewRoomServiceRoomListResult() *RoomServiceRoomListResult {
|
|
return &RoomServiceRoomListResult{}
|
|
}
|
|
|
|
func (p *RoomServiceRoomListResult) InitDefault() {
|
|
}
|
|
|
|
var RoomServiceRoomListResult_Success_DEFAULT *RoomListResp
|
|
|
|
func (p *RoomServiceRoomListResult) GetSuccess() (v *RoomListResp) {
|
|
if !p.IsSetSuccess() {
|
|
return RoomServiceRoomListResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
|
|
var fieldIDToName_RoomServiceRoomListResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *RoomServiceRoomListResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomListResult) 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_RoomServiceRoomListResult[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 *RoomServiceRoomListResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewRoomListResp()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomListResult) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("RoomList_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 *RoomServiceRoomListResult) 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 *RoomServiceRoomListResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RoomServiceRoomListResult(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RoomServiceRoomRemoveArgs struct {
|
|
Request *RemoveRoomReq `thrift:"request,1"`
|
|
}
|
|
|
|
func NewRoomServiceRoomRemoveArgs() *RoomServiceRoomRemoveArgs {
|
|
return &RoomServiceRoomRemoveArgs{}
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveArgs) InitDefault() {
|
|
}
|
|
|
|
var RoomServiceRoomRemoveArgs_Request_DEFAULT *RemoveRoomReq
|
|
|
|
func (p *RoomServiceRoomRemoveArgs) GetRequest() (v *RemoveRoomReq) {
|
|
if !p.IsSetRequest() {
|
|
return RoomServiceRoomRemoveArgs_Request_DEFAULT
|
|
}
|
|
return p.Request
|
|
}
|
|
|
|
var fieldIDToName_RoomServiceRoomRemoveArgs = map[int16]string{
|
|
1: "request",
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveArgs) IsSetRequest() bool {
|
|
return p.Request != nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveArgs) 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_RoomServiceRoomRemoveArgs[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 *RoomServiceRoomRemoveArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
_field := NewRemoveRoomReq()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Request = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("RoomRemove_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 *RoomServiceRoomRemoveArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
|
|
goto WriteFieldBeginError
|
|
}
|
|
if err := p.Request.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 *RoomServiceRoomRemoveArgs) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RoomServiceRoomRemoveArgs(%+v)", *p)
|
|
|
|
}
|
|
|
|
type RoomServiceRoomRemoveResult struct {
|
|
Success *RemoveRoomResp `thrift:"success,0,optional"`
|
|
}
|
|
|
|
func NewRoomServiceRoomRemoveResult() *RoomServiceRoomRemoveResult {
|
|
return &RoomServiceRoomRemoveResult{}
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveResult) InitDefault() {
|
|
}
|
|
|
|
var RoomServiceRoomRemoveResult_Success_DEFAULT *RemoveRoomResp
|
|
|
|
func (p *RoomServiceRoomRemoveResult) GetSuccess() (v *RemoveRoomResp) {
|
|
if !p.IsSetSuccess() {
|
|
return RoomServiceRoomRemoveResult_Success_DEFAULT
|
|
}
|
|
return p.Success
|
|
}
|
|
|
|
var fieldIDToName_RoomServiceRoomRemoveResult = map[int16]string{
|
|
0: "success",
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveResult) IsSetSuccess() bool {
|
|
return p.Success != nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveResult) 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_RoomServiceRoomRemoveResult[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 *RoomServiceRoomRemoveResult) ReadField0(iprot thrift.TProtocol) error {
|
|
_field := NewRemoveRoomResp()
|
|
if err := _field.Read(iprot); err != nil {
|
|
return err
|
|
}
|
|
p.Success = _field
|
|
return nil
|
|
}
|
|
|
|
func (p *RoomServiceRoomRemoveResult) Write(oprot thrift.TProtocol) (err error) {
|
|
var fieldId int16
|
|
if err = oprot.WriteStructBegin("RoomRemove_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 *RoomServiceRoomRemoveResult) 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 *RoomServiceRoomRemoveResult) String() string {
|
|
if p == nil {
|
|
return "<nil>"
|
|
}
|
|
return fmt.Sprintf("RoomServiceRoomRemoveResult(%+v)", *p)
|
|
|
|
}
|