// @generated by Thrift for [[[ program path ]]] // This file is probably not the place you want to edit! package module // [[[ program thrift source path ]]] import ( "context" "fmt" "strings" "sync" thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" metadata "github.com/facebook/fbthrift/thrift/lib/thrift/metadata" ) // (needed to ensure safety because of naive import list construction) var _ = context.Background var _ = fmt.Printf var _ = strings.Split var _ = sync.Mutex{} var _ = thrift.ZERO var _ = metadata.GoUnusedProtection__ type MyService interface { Ping(ctx context.Context) (error) GetRandomData(ctx context.Context) (string, error) HasDataById(ctx context.Context, id int64) (bool, error) GoGetDataById(ctx context.Context, id int64) (string, error) PutDataById(ctx context.Context, id int64, data string) (error) LobDataById(ctx context.Context, id int64, data string) (error) GoDoNothing(ctx context.Context) (error) } type MyServiceChannelClientInterface interface { thrift.ClientInterface MyService } type MyServiceClientInterface interface { thrift.ClientInterface Ping() (error) GetRandomData() (string, error) HasDataById(id int64) (bool, error) GoGetDataById(id int64) (string, error) PutDataById(id int64, data string) (error) LobDataById(id int64, data string) (error) GoDoNothing() (error) } type MyServiceContextClientInterface interface { MyServiceClientInterface PingContext(ctx context.Context) (error) GetRandomDataContext(ctx context.Context) (string, error) HasDataByIdContext(ctx context.Context, id int64) (bool, error) GoGetDataByIdContext(ctx context.Context, id int64) (string, error) PutDataByIdContext(ctx context.Context, id int64, data string) (error) LobDataByIdContext(ctx context.Context, id int64, data string) (error) GoDoNothingContext(ctx context.Context) (error) } type MyServiceChannelClient struct { ch thrift.RequestChannel } // Compile time interface enforcer var _ MyServiceChannelClientInterface = &MyServiceChannelClient{} func NewMyServiceChannelClient(channel thrift.RequestChannel) *MyServiceChannelClient { return &MyServiceChannelClient{ ch: channel, } } func (c *MyServiceChannelClient) Close() error { return c.ch.Close() } type MyServiceClient struct { chClient *MyServiceChannelClient Mu sync.Mutex } // Compile time interface enforcer var _ MyServiceClientInterface = &MyServiceClient{} var _ MyServiceContextClientInterface = &MyServiceClient{} func NewMyServiceClient(prot thrift.Protocol) *MyServiceClient { return &MyServiceClient{ chClient: NewMyServiceChannelClient( thrift.NewSerialChannel(prot), ), } } func (c *MyServiceClient) Close() error { return c.chClient.Close() } func (c *MyServiceChannelClient) Ping(ctx context.Context) (error) { in := &reqMyServicePing{ } out := newRespMyServicePing() err := c.ch.Call(ctx, "ping", in, out) if err != nil { return err } else if out.MyExcept != nil { return out.MyExcept } return nil } func (c *MyServiceClient) Ping() (error) { return c.chClient.Ping(context.Background()) } func (c *MyServiceClient) PingContext(ctx context.Context) (error) { return c.chClient.Ping(ctx) } func (c *MyServiceChannelClient) GetRandomData(ctx context.Context) (string, error) { in := &reqMyServiceGetRandomData{ } out := newRespMyServiceGetRandomData() err := c.ch.Call(ctx, "getRandomData", in, out) if err != nil { return "", err } return out.GetSuccess(), nil } func (c *MyServiceClient) GetRandomData() (string, error) { return c.chClient.GetRandomData(context.Background()) } func (c *MyServiceClient) GetRandomDataContext(ctx context.Context) (string, error) { return c.chClient.GetRandomData(ctx) } func (c *MyServiceChannelClient) HasDataById(ctx context.Context, id int64) (bool, error) { in := &reqMyServiceHasDataById{ Id: id, } out := newRespMyServiceHasDataById() err := c.ch.Call(ctx, "hasDataById", in, out) if err != nil { return false, err } return out.GetSuccess(), nil } func (c *MyServiceClient) HasDataById(id int64) (bool, error) { return c.chClient.HasDataById(context.Background(), id) } func (c *MyServiceClient) HasDataByIdContext(ctx context.Context, id int64) (bool, error) { return c.chClient.HasDataById(ctx, id) } func (c *MyServiceChannelClient) GoGetDataById(ctx context.Context, id int64) (string, error) { in := &reqMyServiceGoGetDataById{ Id: id, } out := newRespMyServiceGoGetDataById() err := c.ch.Call(ctx, "getDataById", in, out) if err != nil { return "", err } return out.GetSuccess(), nil } func (c *MyServiceClient) GoGetDataById(id int64) (string, error) { return c.chClient.GoGetDataById(context.Background(), id) } func (c *MyServiceClient) GoGetDataByIdContext(ctx context.Context, id int64) (string, error) { return c.chClient.GoGetDataById(ctx, id) } func (c *MyServiceChannelClient) PutDataById(ctx context.Context, id int64, data string) (error) { in := &reqMyServicePutDataById{ Id: id, Data: data, } out := newRespMyServicePutDataById() err := c.ch.Call(ctx, "putDataById", in, out) if err != nil { return err } return nil } func (c *MyServiceClient) PutDataById(id int64, data string) (error) { return c.chClient.PutDataById(context.Background(), id, data) } func (c *MyServiceClient) PutDataByIdContext(ctx context.Context, id int64, data string) (error) { return c.chClient.PutDataById(ctx, id, data) } func (c *MyServiceChannelClient) LobDataById(ctx context.Context, id int64, data string) (error) { in := &reqMyServiceLobDataById{ Id: id, Data: data, } return c.ch.Oneway(ctx, "lobDataById", in) } func (c *MyServiceClient) LobDataById(id int64, data string) (error) { return c.chClient.LobDataById(context.Background(), id, data) } func (c *MyServiceClient) LobDataByIdContext(ctx context.Context, id int64, data string) (error) { return c.chClient.LobDataById(ctx, id, data) } func (c *MyServiceChannelClient) GoDoNothing(ctx context.Context) (error) { in := &reqMyServiceGoDoNothing{ } out := newRespMyServiceGoDoNothing() err := c.ch.Call(ctx, "doNothing", in, out) if err != nil { return err } return nil } func (c *MyServiceClient) GoDoNothing() (error) { return c.chClient.GoDoNothing(context.Background()) } func (c *MyServiceClient) GoDoNothingContext(ctx context.Context) (error) { return c.chClient.GoDoNothing(ctx) } type reqMyServicePing struct { } // Compile time interface enforcer var _ thrift.Struct = &reqMyServicePing{} // Deprecated: MyServicePingArgsDeprecated is deprecated, since it is supposed to be internal. type MyServicePingArgsDeprecated = reqMyServicePing func newReqMyServicePing() *reqMyServicePing { return (&reqMyServicePing{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePing().Set().Set() type reqMyServicePingBuilder struct { obj *reqMyServicePing } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePing().Set().Set() func newReqMyServicePingBuilder() *reqMyServicePingBuilder { return &reqMyServicePingBuilder{ obj: newReqMyServicePing(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePing().Set().Set() func (x *reqMyServicePingBuilder) Emit() *reqMyServicePing { var objCopy reqMyServicePing = *x.obj return &objCopy } func (x *reqMyServicePing) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServicePing"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServicePing) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServicePing) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServicePing({") sb.WriteString("})") return sb.String() } type respMyServicePing struct { MyExcept *MyException `thrift:"myExcept,1,optional" json:"myExcept,omitempty" db:"myExcept"` } // Compile time interface enforcer var _ thrift.Struct = &respMyServicePing{} var _ thrift.WritableResult = &respMyServicePing{} // Deprecated: MyServicePingResultDeprecated is deprecated, since it is supposed to be internal. type MyServicePingResultDeprecated = respMyServicePing func newRespMyServicePing() *respMyServicePing { return (&respMyServicePing{}) } func (x *respMyServicePing) GetMyExceptNonCompat() *MyException { return x.MyExcept } func (x *respMyServicePing) GetMyExcept() *MyException { if !x.IsSetMyExcept() { return nil } return x.MyExcept } func (x *respMyServicePing) SetMyExceptNonCompat(value MyException) *respMyServicePing { x.MyExcept = &value return x } func (x *respMyServicePing) SetMyExcept(value *MyException) *respMyServicePing { x.MyExcept = value return x } func (x *respMyServicePing) IsSetMyExcept() bool { return x != nil && x.MyExcept != nil } func (x *respMyServicePing) writeField1(p thrift.Format) error { // MyExcept if !x.IsSetMyExcept() { return nil } if err := p.WriteFieldBegin("myExcept", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetMyExceptNonCompat() if err := item.Write(p); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *respMyServicePing) readField1(p thrift.Format) error { // MyExcept result := *NewMyException() err := result.Read(p) if err != nil { return err } x.SetMyExceptNonCompat(result) return nil } func (x *respMyServicePing) toString1() string { // MyExcept return fmt.Sprintf("%v", x.GetMyExceptNonCompat()) } // Deprecated: Use newRespMyServicePing().GetMyExcept() instead. func (x *respMyServicePing) DefaultGetMyExcept() *MyException { if !x.IsSetMyExcept() { return NewMyException() } return x.MyExcept } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePing().Set().Set() type respMyServicePingBuilder struct { obj *respMyServicePing } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePing().Set().Set() func newRespMyServicePingBuilder() *respMyServicePingBuilder { return &respMyServicePingBuilder{ obj: newRespMyServicePing(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePing().Set().Set() func (x *respMyServicePingBuilder) MyExcept(value *MyException) *respMyServicePingBuilder { x.obj.MyExcept = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePing().Set().Set() func (x *respMyServicePingBuilder) Emit() *respMyServicePing { var objCopy respMyServicePing = *x.obj return &objCopy } func (x *respMyServicePing) Exception() thrift.WritableException { if x.MyExcept != nil { return x.MyExcept } return nil } func (x *respMyServicePing) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServicePing"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServicePing) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.STRUCT)): // myExcept if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServicePing) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServicePing({") sb.WriteString(fmt.Sprintf("MyExcept:%s", x.toString1())) sb.WriteString("})") return sb.String() } type reqMyServiceGetRandomData struct { } // Compile time interface enforcer var _ thrift.Struct = &reqMyServiceGetRandomData{} // Deprecated: MyServiceGetRandomDataArgsDeprecated is deprecated, since it is supposed to be internal. type MyServiceGetRandomDataArgsDeprecated = reqMyServiceGetRandomData func newReqMyServiceGetRandomData() *reqMyServiceGetRandomData { return (&reqMyServiceGetRandomData{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGetRandomData().Set().Set() type reqMyServiceGetRandomDataBuilder struct { obj *reqMyServiceGetRandomData } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGetRandomData().Set().Set() func newReqMyServiceGetRandomDataBuilder() *reqMyServiceGetRandomDataBuilder { return &reqMyServiceGetRandomDataBuilder{ obj: newReqMyServiceGetRandomData(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGetRandomData().Set().Set() func (x *reqMyServiceGetRandomDataBuilder) Emit() *reqMyServiceGetRandomData { var objCopy reqMyServiceGetRandomData = *x.obj return &objCopy } func (x *reqMyServiceGetRandomData) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServiceGetRandomData"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServiceGetRandomData) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServiceGetRandomData) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServiceGetRandomData({") sb.WriteString("})") return sb.String() } type respMyServiceGetRandomData struct { Success *string `thrift:"success,0,optional" json:"success,omitempty" db:"success"` } // Compile time interface enforcer var _ thrift.Struct = &respMyServiceGetRandomData{} var _ thrift.WritableResult = &respMyServiceGetRandomData{} // Deprecated: MyServiceGetRandomDataResultDeprecated is deprecated, since it is supposed to be internal. type MyServiceGetRandomDataResultDeprecated = respMyServiceGetRandomData func newRespMyServiceGetRandomData() *respMyServiceGetRandomData { return (&respMyServiceGetRandomData{}) } func (x *respMyServiceGetRandomData) GetSuccessNonCompat() *string { return x.Success } func (x *respMyServiceGetRandomData) GetSuccess() string { if !x.IsSetSuccess() { return "" } return *x.Success } func (x *respMyServiceGetRandomData) SetSuccessNonCompat(value string) *respMyServiceGetRandomData { x.Success = &value return x } func (x *respMyServiceGetRandomData) SetSuccess(value *string) *respMyServiceGetRandomData { x.Success = value return x } func (x *respMyServiceGetRandomData) IsSetSuccess() bool { return x != nil && x.Success != nil } func (x *respMyServiceGetRandomData) writeField0(p thrift.Format) error { // Success if !x.IsSetSuccess() { return nil } if err := p.WriteFieldBegin("success", thrift.STRING, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := *x.GetSuccessNonCompat() if err := p.WriteString(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *respMyServiceGetRandomData) readField0(p thrift.Format) error { // Success result, err := p.ReadString() if err != nil { return err } x.SetSuccessNonCompat(result) return nil } func (x *respMyServiceGetRandomData) toString0() string { // Success if x.IsSetSuccess() { return fmt.Sprintf("%v", *x.GetSuccessNonCompat()) } return fmt.Sprintf("%v", x.GetSuccessNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGetRandomData().Set().Set() type respMyServiceGetRandomDataBuilder struct { obj *respMyServiceGetRandomData } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGetRandomData().Set().Set() func newRespMyServiceGetRandomDataBuilder() *respMyServiceGetRandomDataBuilder { return &respMyServiceGetRandomDataBuilder{ obj: newRespMyServiceGetRandomData(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGetRandomData().Set().Set() func (x *respMyServiceGetRandomDataBuilder) Success(value *string) *respMyServiceGetRandomDataBuilder { x.obj.Success = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGetRandomData().Set().Set() func (x *respMyServiceGetRandomDataBuilder) Emit() *respMyServiceGetRandomData { var objCopy respMyServiceGetRandomData = *x.obj return &objCopy } func (x *respMyServiceGetRandomData) Exception() thrift.WritableException { return nil } func (x *respMyServiceGetRandomData) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServiceGetRandomData"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField0(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServiceGetRandomData) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 0 && wireType == thrift.Type(thrift.STRING)): // success if err := x.readField0(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServiceGetRandomData) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServiceGetRandomData({") sb.WriteString(fmt.Sprintf("Success:%s", x.toString0())) sb.WriteString("})") return sb.String() } type reqMyServiceHasDataById struct { Id int64 `thrift:"id,1" json:"id" db:"id"` } // Compile time interface enforcer var _ thrift.Struct = &reqMyServiceHasDataById{} // Deprecated: MyServiceHasDataByIdArgsDeprecated is deprecated, since it is supposed to be internal. type MyServiceHasDataByIdArgsDeprecated = reqMyServiceHasDataById func newReqMyServiceHasDataById() *reqMyServiceHasDataById { return (&reqMyServiceHasDataById{}). SetIdNonCompat(0) } func (x *reqMyServiceHasDataById) GetIdNonCompat() int64 { return x.Id } func (x *reqMyServiceHasDataById) GetId() int64 { return x.Id } func (x *reqMyServiceHasDataById) SetIdNonCompat(value int64) *reqMyServiceHasDataById { x.Id = value return x } func (x *reqMyServiceHasDataById) SetId(value int64) *reqMyServiceHasDataById { x.Id = value return x } func (x *reqMyServiceHasDataById) writeField1(p thrift.Format) error { // Id if err := p.WriteFieldBegin("id", thrift.I64, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetIdNonCompat() if err := p.WriteI64(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqMyServiceHasDataById) readField1(p thrift.Format) error { // Id result, err := p.ReadI64() if err != nil { return err } x.SetIdNonCompat(result) return nil } func (x *reqMyServiceHasDataById) toString1() string { // Id return fmt.Sprintf("%v", x.GetIdNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceHasDataById().Set().Set() type reqMyServiceHasDataByIdBuilder struct { obj *reqMyServiceHasDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceHasDataById().Set().Set() func newReqMyServiceHasDataByIdBuilder() *reqMyServiceHasDataByIdBuilder { return &reqMyServiceHasDataByIdBuilder{ obj: newReqMyServiceHasDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceHasDataById().Set().Set() func (x *reqMyServiceHasDataByIdBuilder) Id(value int64) *reqMyServiceHasDataByIdBuilder { x.obj.Id = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceHasDataById().Set().Set() func (x *reqMyServiceHasDataByIdBuilder) Emit() *reqMyServiceHasDataById { var objCopy reqMyServiceHasDataById = *x.obj return &objCopy } func (x *reqMyServiceHasDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServiceHasDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServiceHasDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.I64)): // id if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServiceHasDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServiceHasDataById({") sb.WriteString(fmt.Sprintf("Id:%s", x.toString1())) sb.WriteString("})") return sb.String() } type respMyServiceHasDataById struct { Success *bool `thrift:"success,0,optional" json:"success,omitempty" db:"success"` } // Compile time interface enforcer var _ thrift.Struct = &respMyServiceHasDataById{} var _ thrift.WritableResult = &respMyServiceHasDataById{} // Deprecated: MyServiceHasDataByIdResultDeprecated is deprecated, since it is supposed to be internal. type MyServiceHasDataByIdResultDeprecated = respMyServiceHasDataById func newRespMyServiceHasDataById() *respMyServiceHasDataById { return (&respMyServiceHasDataById{}) } func (x *respMyServiceHasDataById) GetSuccessNonCompat() *bool { return x.Success } func (x *respMyServiceHasDataById) GetSuccess() bool { if !x.IsSetSuccess() { return false } return *x.Success } func (x *respMyServiceHasDataById) SetSuccessNonCompat(value bool) *respMyServiceHasDataById { x.Success = &value return x } func (x *respMyServiceHasDataById) SetSuccess(value *bool) *respMyServiceHasDataById { x.Success = value return x } func (x *respMyServiceHasDataById) IsSetSuccess() bool { return x != nil && x.Success != nil } func (x *respMyServiceHasDataById) writeField0(p thrift.Format) error { // Success if !x.IsSetSuccess() { return nil } if err := p.WriteFieldBegin("success", thrift.BOOL, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := *x.GetSuccessNonCompat() if err := p.WriteBool(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *respMyServiceHasDataById) readField0(p thrift.Format) error { // Success result, err := p.ReadBool() if err != nil { return err } x.SetSuccessNonCompat(result) return nil } func (x *respMyServiceHasDataById) toString0() string { // Success if x.IsSetSuccess() { return fmt.Sprintf("%v", *x.GetSuccessNonCompat()) } return fmt.Sprintf("%v", x.GetSuccessNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceHasDataById().Set().Set() type respMyServiceHasDataByIdBuilder struct { obj *respMyServiceHasDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceHasDataById().Set().Set() func newRespMyServiceHasDataByIdBuilder() *respMyServiceHasDataByIdBuilder { return &respMyServiceHasDataByIdBuilder{ obj: newRespMyServiceHasDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceHasDataById().Set().Set() func (x *respMyServiceHasDataByIdBuilder) Success(value *bool) *respMyServiceHasDataByIdBuilder { x.obj.Success = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceHasDataById().Set().Set() func (x *respMyServiceHasDataByIdBuilder) Emit() *respMyServiceHasDataById { var objCopy respMyServiceHasDataById = *x.obj return &objCopy } func (x *respMyServiceHasDataById) Exception() thrift.WritableException { return nil } func (x *respMyServiceHasDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServiceHasDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField0(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServiceHasDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 0 && wireType == thrift.Type(thrift.BOOL)): // success if err := x.readField0(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServiceHasDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServiceHasDataById({") sb.WriteString(fmt.Sprintf("Success:%s", x.toString0())) sb.WriteString("})") return sb.String() } type reqMyServiceGoGetDataById struct { Id int64 `thrift:"id,1" json:"id" db:"id"` } // Compile time interface enforcer var _ thrift.Struct = &reqMyServiceGoGetDataById{} // Deprecated: MyServiceGoGetDataByIdArgsDeprecated is deprecated, since it is supposed to be internal. type MyServiceGoGetDataByIdArgsDeprecated = reqMyServiceGoGetDataById func newReqMyServiceGoGetDataById() *reqMyServiceGoGetDataById { return (&reqMyServiceGoGetDataById{}). SetIdNonCompat(0) } func (x *reqMyServiceGoGetDataById) GetIdNonCompat() int64 { return x.Id } func (x *reqMyServiceGoGetDataById) GetId() int64 { return x.Id } func (x *reqMyServiceGoGetDataById) SetIdNonCompat(value int64) *reqMyServiceGoGetDataById { x.Id = value return x } func (x *reqMyServiceGoGetDataById) SetId(value int64) *reqMyServiceGoGetDataById { x.Id = value return x } func (x *reqMyServiceGoGetDataById) writeField1(p thrift.Format) error { // Id if err := p.WriteFieldBegin("id", thrift.I64, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetIdNonCompat() if err := p.WriteI64(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqMyServiceGoGetDataById) readField1(p thrift.Format) error { // Id result, err := p.ReadI64() if err != nil { return err } x.SetIdNonCompat(result) return nil } func (x *reqMyServiceGoGetDataById) toString1() string { // Id return fmt.Sprintf("%v", x.GetIdNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGoGetDataById().Set().Set() type reqMyServiceGoGetDataByIdBuilder struct { obj *reqMyServiceGoGetDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGoGetDataById().Set().Set() func newReqMyServiceGoGetDataByIdBuilder() *reqMyServiceGoGetDataByIdBuilder { return &reqMyServiceGoGetDataByIdBuilder{ obj: newReqMyServiceGoGetDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGoGetDataById().Set().Set() func (x *reqMyServiceGoGetDataByIdBuilder) Id(value int64) *reqMyServiceGoGetDataByIdBuilder { x.obj.Id = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGoGetDataById().Set().Set() func (x *reqMyServiceGoGetDataByIdBuilder) Emit() *reqMyServiceGoGetDataById { var objCopy reqMyServiceGoGetDataById = *x.obj return &objCopy } func (x *reqMyServiceGoGetDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServiceGoGetDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServiceGoGetDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.I64)): // id if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServiceGoGetDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServiceGoGetDataById({") sb.WriteString(fmt.Sprintf("Id:%s", x.toString1())) sb.WriteString("})") return sb.String() } type respMyServiceGoGetDataById struct { Success *string `thrift:"success,0,optional" json:"success,omitempty" db:"success"` } // Compile time interface enforcer var _ thrift.Struct = &respMyServiceGoGetDataById{} var _ thrift.WritableResult = &respMyServiceGoGetDataById{} // Deprecated: MyServiceGoGetDataByIdResultDeprecated is deprecated, since it is supposed to be internal. type MyServiceGoGetDataByIdResultDeprecated = respMyServiceGoGetDataById func newRespMyServiceGoGetDataById() *respMyServiceGoGetDataById { return (&respMyServiceGoGetDataById{}) } func (x *respMyServiceGoGetDataById) GetSuccessNonCompat() *string { return x.Success } func (x *respMyServiceGoGetDataById) GetSuccess() string { if !x.IsSetSuccess() { return "" } return *x.Success } func (x *respMyServiceGoGetDataById) SetSuccessNonCompat(value string) *respMyServiceGoGetDataById { x.Success = &value return x } func (x *respMyServiceGoGetDataById) SetSuccess(value *string) *respMyServiceGoGetDataById { x.Success = value return x } func (x *respMyServiceGoGetDataById) IsSetSuccess() bool { return x != nil && x.Success != nil } func (x *respMyServiceGoGetDataById) writeField0(p thrift.Format) error { // Success if !x.IsSetSuccess() { return nil } if err := p.WriteFieldBegin("success", thrift.STRING, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := *x.GetSuccessNonCompat() if err := p.WriteString(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *respMyServiceGoGetDataById) readField0(p thrift.Format) error { // Success result, err := p.ReadString() if err != nil { return err } x.SetSuccessNonCompat(result) return nil } func (x *respMyServiceGoGetDataById) toString0() string { // Success if x.IsSetSuccess() { return fmt.Sprintf("%v", *x.GetSuccessNonCompat()) } return fmt.Sprintf("%v", x.GetSuccessNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGoGetDataById().Set().Set() type respMyServiceGoGetDataByIdBuilder struct { obj *respMyServiceGoGetDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGoGetDataById().Set().Set() func newRespMyServiceGoGetDataByIdBuilder() *respMyServiceGoGetDataByIdBuilder { return &respMyServiceGoGetDataByIdBuilder{ obj: newRespMyServiceGoGetDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGoGetDataById().Set().Set() func (x *respMyServiceGoGetDataByIdBuilder) Success(value *string) *respMyServiceGoGetDataByIdBuilder { x.obj.Success = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGoGetDataById().Set().Set() func (x *respMyServiceGoGetDataByIdBuilder) Emit() *respMyServiceGoGetDataById { var objCopy respMyServiceGoGetDataById = *x.obj return &objCopy } func (x *respMyServiceGoGetDataById) Exception() thrift.WritableException { return nil } func (x *respMyServiceGoGetDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServiceGoGetDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField0(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServiceGoGetDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 0 && wireType == thrift.Type(thrift.STRING)): // success if err := x.readField0(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServiceGoGetDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServiceGoGetDataById({") sb.WriteString(fmt.Sprintf("Success:%s", x.toString0())) sb.WriteString("})") return sb.String() } type reqMyServicePutDataById struct { Id int64 `thrift:"id,1" json:"id" db:"id"` Data string `thrift:"data,2" json:"data" db:"data"` } // Compile time interface enforcer var _ thrift.Struct = &reqMyServicePutDataById{} // Deprecated: MyServicePutDataByIdArgsDeprecated is deprecated, since it is supposed to be internal. type MyServicePutDataByIdArgsDeprecated = reqMyServicePutDataById func newReqMyServicePutDataById() *reqMyServicePutDataById { return (&reqMyServicePutDataById{}). SetIdNonCompat(0). SetDataNonCompat("") } func (x *reqMyServicePutDataById) GetIdNonCompat() int64 { return x.Id } func (x *reqMyServicePutDataById) GetId() int64 { return x.Id } func (x *reqMyServicePutDataById) GetDataNonCompat() string { return x.Data } func (x *reqMyServicePutDataById) GetData() string { return x.Data } func (x *reqMyServicePutDataById) SetIdNonCompat(value int64) *reqMyServicePutDataById { x.Id = value return x } func (x *reqMyServicePutDataById) SetId(value int64) *reqMyServicePutDataById { x.Id = value return x } func (x *reqMyServicePutDataById) SetDataNonCompat(value string) *reqMyServicePutDataById { x.Data = value return x } func (x *reqMyServicePutDataById) SetData(value string) *reqMyServicePutDataById { x.Data = value return x } func (x *reqMyServicePutDataById) writeField1(p thrift.Format) error { // Id if err := p.WriteFieldBegin("id", thrift.I64, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetIdNonCompat() if err := p.WriteI64(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqMyServicePutDataById) writeField2(p thrift.Format) error { // Data if err := p.WriteFieldBegin("data", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetDataNonCompat() if err := p.WriteString(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqMyServicePutDataById) readField1(p thrift.Format) error { // Id result, err := p.ReadI64() if err != nil { return err } x.SetIdNonCompat(result) return nil } func (x *reqMyServicePutDataById) readField2(p thrift.Format) error { // Data result, err := p.ReadString() if err != nil { return err } x.SetDataNonCompat(result) return nil } func (x *reqMyServicePutDataById) toString1() string { // Id return fmt.Sprintf("%v", x.GetIdNonCompat()) } func (x *reqMyServicePutDataById) toString2() string { // Data return fmt.Sprintf("%v", x.GetDataNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePutDataById().Set().Set() type reqMyServicePutDataByIdBuilder struct { obj *reqMyServicePutDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePutDataById().Set().Set() func newReqMyServicePutDataByIdBuilder() *reqMyServicePutDataByIdBuilder { return &reqMyServicePutDataByIdBuilder{ obj: newReqMyServicePutDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePutDataById().Set().Set() func (x *reqMyServicePutDataByIdBuilder) Id(value int64) *reqMyServicePutDataByIdBuilder { x.obj.Id = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePutDataById().Set().Set() func (x *reqMyServicePutDataByIdBuilder) Data(value string) *reqMyServicePutDataByIdBuilder { x.obj.Data = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePutDataById().Set().Set() func (x *reqMyServicePutDataByIdBuilder) Emit() *reqMyServicePutDataById { var objCopy reqMyServicePutDataById = *x.obj return &objCopy } func (x *reqMyServicePutDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServicePutDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := x.writeField2(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServicePutDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.I64)): // id if err := x.readField1(p); err != nil { return err } case (id == 2 && wireType == thrift.Type(thrift.STRING)): // data if err := x.readField2(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServicePutDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServicePutDataById({") sb.WriteString(fmt.Sprintf("Id:%s ", x.toString1())) sb.WriteString(fmt.Sprintf("Data:%s", x.toString2())) sb.WriteString("})") return sb.String() } type respMyServicePutDataById struct { } // Compile time interface enforcer var _ thrift.Struct = &respMyServicePutDataById{} var _ thrift.WritableResult = &respMyServicePutDataById{} // Deprecated: MyServicePutDataByIdResultDeprecated is deprecated, since it is supposed to be internal. type MyServicePutDataByIdResultDeprecated = respMyServicePutDataById func newRespMyServicePutDataById() *respMyServicePutDataById { return (&respMyServicePutDataById{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePutDataById().Set().Set() type respMyServicePutDataByIdBuilder struct { obj *respMyServicePutDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePutDataById().Set().Set() func newRespMyServicePutDataByIdBuilder() *respMyServicePutDataByIdBuilder { return &respMyServicePutDataByIdBuilder{ obj: newRespMyServicePutDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePutDataById().Set().Set() func (x *respMyServicePutDataByIdBuilder) Emit() *respMyServicePutDataById { var objCopy respMyServicePutDataById = *x.obj return &objCopy } func (x *respMyServicePutDataById) Exception() thrift.WritableException { return nil } func (x *respMyServicePutDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServicePutDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServicePutDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServicePutDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServicePutDataById({") sb.WriteString("})") return sb.String() } type reqMyServiceLobDataById struct { Id int64 `thrift:"id,1" json:"id" db:"id"` Data string `thrift:"data,2" json:"data" db:"data"` } // Compile time interface enforcer var _ thrift.Struct = &reqMyServiceLobDataById{} // Deprecated: MyServiceLobDataByIdArgsDeprecated is deprecated, since it is supposed to be internal. type MyServiceLobDataByIdArgsDeprecated = reqMyServiceLobDataById func newReqMyServiceLobDataById() *reqMyServiceLobDataById { return (&reqMyServiceLobDataById{}). SetIdNonCompat(0). SetDataNonCompat("") } func (x *reqMyServiceLobDataById) GetIdNonCompat() int64 { return x.Id } func (x *reqMyServiceLobDataById) GetId() int64 { return x.Id } func (x *reqMyServiceLobDataById) GetDataNonCompat() string { return x.Data } func (x *reqMyServiceLobDataById) GetData() string { return x.Data } func (x *reqMyServiceLobDataById) SetIdNonCompat(value int64) *reqMyServiceLobDataById { x.Id = value return x } func (x *reqMyServiceLobDataById) SetId(value int64) *reqMyServiceLobDataById { x.Id = value return x } func (x *reqMyServiceLobDataById) SetDataNonCompat(value string) *reqMyServiceLobDataById { x.Data = value return x } func (x *reqMyServiceLobDataById) SetData(value string) *reqMyServiceLobDataById { x.Data = value return x } func (x *reqMyServiceLobDataById) writeField1(p thrift.Format) error { // Id if err := p.WriteFieldBegin("id", thrift.I64, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetIdNonCompat() if err := p.WriteI64(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqMyServiceLobDataById) writeField2(p thrift.Format) error { // Data if err := p.WriteFieldBegin("data", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetDataNonCompat() if err := p.WriteString(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqMyServiceLobDataById) readField1(p thrift.Format) error { // Id result, err := p.ReadI64() if err != nil { return err } x.SetIdNonCompat(result) return nil } func (x *reqMyServiceLobDataById) readField2(p thrift.Format) error { // Data result, err := p.ReadString() if err != nil { return err } x.SetDataNonCompat(result) return nil } func (x *reqMyServiceLobDataById) toString1() string { // Id return fmt.Sprintf("%v", x.GetIdNonCompat()) } func (x *reqMyServiceLobDataById) toString2() string { // Data return fmt.Sprintf("%v", x.GetDataNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceLobDataById().Set().Set() type reqMyServiceLobDataByIdBuilder struct { obj *reqMyServiceLobDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceLobDataById().Set().Set() func newReqMyServiceLobDataByIdBuilder() *reqMyServiceLobDataByIdBuilder { return &reqMyServiceLobDataByIdBuilder{ obj: newReqMyServiceLobDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceLobDataById().Set().Set() func (x *reqMyServiceLobDataByIdBuilder) Id(value int64) *reqMyServiceLobDataByIdBuilder { x.obj.Id = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceLobDataById().Set().Set() func (x *reqMyServiceLobDataByIdBuilder) Data(value string) *reqMyServiceLobDataByIdBuilder { x.obj.Data = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceLobDataById().Set().Set() func (x *reqMyServiceLobDataByIdBuilder) Emit() *reqMyServiceLobDataById { var objCopy reqMyServiceLobDataById = *x.obj return &objCopy } func (x *reqMyServiceLobDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServiceLobDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := x.writeField2(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServiceLobDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.I64)): // id if err := x.readField1(p); err != nil { return err } case (id == 2 && wireType == thrift.Type(thrift.STRING)): // data if err := x.readField2(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServiceLobDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServiceLobDataById({") sb.WriteString(fmt.Sprintf("Id:%s ", x.toString1())) sb.WriteString(fmt.Sprintf("Data:%s", x.toString2())) sb.WriteString("})") return sb.String() } type respMyServiceLobDataById struct { } // Compile time interface enforcer var _ thrift.Struct = &respMyServiceLobDataById{} var _ thrift.WritableResult = &respMyServiceLobDataById{} // Deprecated: MyServiceLobDataByIdResultDeprecated is deprecated, since it is supposed to be internal. type MyServiceLobDataByIdResultDeprecated = respMyServiceLobDataById func newRespMyServiceLobDataById() *respMyServiceLobDataById { return (&respMyServiceLobDataById{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceLobDataById().Set().Set() type respMyServiceLobDataByIdBuilder struct { obj *respMyServiceLobDataById } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceLobDataById().Set().Set() func newRespMyServiceLobDataByIdBuilder() *respMyServiceLobDataByIdBuilder { return &respMyServiceLobDataByIdBuilder{ obj: newRespMyServiceLobDataById(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceLobDataById().Set().Set() func (x *respMyServiceLobDataByIdBuilder) Emit() *respMyServiceLobDataById { var objCopy respMyServiceLobDataById = *x.obj return &objCopy } func (x *respMyServiceLobDataById) Exception() thrift.WritableException { return nil } func (x *respMyServiceLobDataById) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServiceLobDataById"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServiceLobDataById) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServiceLobDataById) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServiceLobDataById({") sb.WriteString("})") return sb.String() } type reqMyServiceGoDoNothing struct { } // Compile time interface enforcer var _ thrift.Struct = &reqMyServiceGoDoNothing{} // Deprecated: MyServiceGoDoNothingArgsDeprecated is deprecated, since it is supposed to be internal. type MyServiceGoDoNothingArgsDeprecated = reqMyServiceGoDoNothing func newReqMyServiceGoDoNothing() *reqMyServiceGoDoNothing { return (&reqMyServiceGoDoNothing{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGoDoNothing().Set().Set() type reqMyServiceGoDoNothingBuilder struct { obj *reqMyServiceGoDoNothing } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGoDoNothing().Set().Set() func newReqMyServiceGoDoNothingBuilder() *reqMyServiceGoDoNothingBuilder { return &reqMyServiceGoDoNothingBuilder{ obj: newReqMyServiceGoDoNothing(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServiceGoDoNothing().Set().Set() func (x *reqMyServiceGoDoNothingBuilder) Emit() *reqMyServiceGoDoNothing { var objCopy reqMyServiceGoDoNothing = *x.obj return &objCopy } func (x *reqMyServiceGoDoNothing) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServiceGoDoNothing"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServiceGoDoNothing) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServiceGoDoNothing) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServiceGoDoNothing({") sb.WriteString("})") return sb.String() } type respMyServiceGoDoNothing struct { } // Compile time interface enforcer var _ thrift.Struct = &respMyServiceGoDoNothing{} var _ thrift.WritableResult = &respMyServiceGoDoNothing{} // Deprecated: MyServiceGoDoNothingResultDeprecated is deprecated, since it is supposed to be internal. type MyServiceGoDoNothingResultDeprecated = respMyServiceGoDoNothing func newRespMyServiceGoDoNothing() *respMyServiceGoDoNothing { return (&respMyServiceGoDoNothing{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGoDoNothing().Set().Set() type respMyServiceGoDoNothingBuilder struct { obj *respMyServiceGoDoNothing } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGoDoNothing().Set().Set() func newRespMyServiceGoDoNothingBuilder() *respMyServiceGoDoNothingBuilder { return &respMyServiceGoDoNothingBuilder{ obj: newRespMyServiceGoDoNothing(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServiceGoDoNothing().Set().Set() func (x *respMyServiceGoDoNothingBuilder) Emit() *respMyServiceGoDoNothing { var objCopy respMyServiceGoDoNothing = *x.obj return &objCopy } func (x *respMyServiceGoDoNothing) Exception() thrift.WritableException { return nil } func (x *respMyServiceGoDoNothing) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServiceGoDoNothing"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServiceGoDoNothing) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServiceGoDoNothing) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServiceGoDoNothing({") sb.WriteString("})") return sb.String() } type MyServiceProcessor struct { processorMap map[string]thrift.ProcessorFunctionContext functionServiceMap map[string]string handler MyService } // Compile time interface enforcer var _ thrift.ProcessorContext = &MyServiceProcessor{} func NewMyServiceProcessor(handler MyService) *MyServiceProcessor { p := &MyServiceProcessor{ handler: handler, processorMap: make(map[string]thrift.ProcessorFunctionContext), functionServiceMap: make(map[string]string), } p.AddToProcessorMap("ping", &procFuncMyServicePing{handler: handler}) p.AddToProcessorMap("getRandomData", &procFuncMyServiceGetRandomData{handler: handler}) p.AddToProcessorMap("hasDataById", &procFuncMyServiceHasDataById{handler: handler}) p.AddToProcessorMap("getDataById", &procFuncMyServiceGoGetDataById{handler: handler}) p.AddToProcessorMap("putDataById", &procFuncMyServicePutDataById{handler: handler}) p.AddToProcessorMap("lobDataById", &procFuncMyServiceLobDataById{handler: handler}) p.AddToProcessorMap("doNothing", &procFuncMyServiceGoDoNothing{handler: handler}) p.AddToFunctionServiceMap("ping", "MyService") p.AddToFunctionServiceMap("getRandomData", "MyService") p.AddToFunctionServiceMap("hasDataById", "MyService") p.AddToFunctionServiceMap("getDataById", "MyService") p.AddToFunctionServiceMap("putDataById", "MyService") p.AddToFunctionServiceMap("lobDataById", "MyService") p.AddToFunctionServiceMap("doNothing", "MyService") return p } func (p *MyServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { p.processorMap[key] = processor } func (p *MyServiceProcessor) AddToFunctionServiceMap(key, service string) { p.functionServiceMap[key] = service } func (p *MyServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { if processor, ok := p.processorMap[key]; ok { return processor, nil } return nil, nil } func (p *MyServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { return p.processorMap } func (p *MyServiceProcessor) FunctionServiceMap() map[string]string { return p.functionServiceMap } func (p *MyServiceProcessor) GetThriftMetadata() *metadata.ThriftMetadata { return GetThriftMetadataForService("module.MyService") } type procFuncMyServicePing struct { handler MyService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServicePing{} func (p *procFuncMyServicePing) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServicePing() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServicePing) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch v := result.(type) { case *MyException: result = &respMyServicePing{ MyExcept: v, } case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("ping", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServicePing) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespMyServicePing() err := p.handler.Ping(ctx) if err != nil { switch v := err.(type) { case *MyException: result.MyExcept = v return result, nil default: x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing Ping: " + err.Error(), err) return x, x } } return result, nil } type procFuncMyServiceGetRandomData struct { handler MyService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServiceGetRandomData{} func (p *procFuncMyServiceGetRandomData) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServiceGetRandomData() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServiceGetRandomData) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("getRandomData", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServiceGetRandomData) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespMyServiceGetRandomData() retval, err := p.handler.GetRandomData(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing GetRandomData: " + err.Error(), err) return x, x } result.Success = &retval return result, nil } type procFuncMyServiceHasDataById struct { handler MyService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServiceHasDataById{} func (p *procFuncMyServiceHasDataById) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServiceHasDataById() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServiceHasDataById) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("hasDataById", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServiceHasDataById) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqMyServiceHasDataById) result := newRespMyServiceHasDataById() retval, err := p.handler.HasDataById(ctx, args.Id) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing HasDataById: " + err.Error(), err) return x, x } result.Success = &retval return result, nil } type procFuncMyServiceGoGetDataById struct { handler MyService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServiceGoGetDataById{} func (p *procFuncMyServiceGoGetDataById) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServiceGoGetDataById() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServiceGoGetDataById) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("getDataById", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServiceGoGetDataById) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqMyServiceGoGetDataById) result := newRespMyServiceGoGetDataById() retval, err := p.handler.GoGetDataById(ctx, args.Id) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing GoGetDataById: " + err.Error(), err) return x, x } result.Success = &retval return result, nil } type procFuncMyServicePutDataById struct { handler MyService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServicePutDataById{} func (p *procFuncMyServicePutDataById) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServicePutDataById() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServicePutDataById) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("putDataById", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServicePutDataById) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqMyServicePutDataById) result := newRespMyServicePutDataById() err := p.handler.PutDataById(ctx, args.Id, args.Data) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing PutDataById: " + err.Error(), err) return x, x } return result, nil } type procFuncMyServiceLobDataById struct { handler MyService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServiceLobDataById{} func (p *procFuncMyServiceLobDataById) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServiceLobDataById() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServiceLobDataById) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("lobDataById", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServiceLobDataById) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqMyServiceLobDataById) err := p.handler.LobDataById(ctx, args.Id, args.Data) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing LobDataById: " + err.Error(), err) return x, x } return nil, nil } type procFuncMyServiceGoDoNothing struct { handler MyService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServiceGoDoNothing{} func (p *procFuncMyServiceGoDoNothing) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServiceGoDoNothing() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServiceGoDoNothing) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("doNothing", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServiceGoDoNothing) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespMyServiceGoDoNothing() err := p.handler.GoDoNothing(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing GoDoNothing: " + err.Error(), err) return x, x } return result, nil } type MyServicePrioParent interface { Ping(ctx context.Context) (error) Pong(ctx context.Context) (error) } type MyServicePrioParentChannelClientInterface interface { thrift.ClientInterface MyServicePrioParent } type MyServicePrioParentClientInterface interface { thrift.ClientInterface Ping() (error) Pong() (error) } type MyServicePrioParentContextClientInterface interface { MyServicePrioParentClientInterface PingContext(ctx context.Context) (error) PongContext(ctx context.Context) (error) } type MyServicePrioParentChannelClient struct { ch thrift.RequestChannel } // Compile time interface enforcer var _ MyServicePrioParentChannelClientInterface = &MyServicePrioParentChannelClient{} func NewMyServicePrioParentChannelClient(channel thrift.RequestChannel) *MyServicePrioParentChannelClient { return &MyServicePrioParentChannelClient{ ch: channel, } } func (c *MyServicePrioParentChannelClient) Close() error { return c.ch.Close() } type MyServicePrioParentClient struct { chClient *MyServicePrioParentChannelClient Mu sync.Mutex } // Compile time interface enforcer var _ MyServicePrioParentClientInterface = &MyServicePrioParentClient{} var _ MyServicePrioParentContextClientInterface = &MyServicePrioParentClient{} func NewMyServicePrioParentClient(prot thrift.Protocol) *MyServicePrioParentClient { return &MyServicePrioParentClient{ chClient: NewMyServicePrioParentChannelClient( thrift.NewSerialChannel(prot), ), } } func (c *MyServicePrioParentClient) Close() error { return c.chClient.Close() } func (c *MyServicePrioParentChannelClient) Ping(ctx context.Context) (error) { in := &reqMyServicePrioParentPing{ } out := newRespMyServicePrioParentPing() err := c.ch.Call(ctx, "ping", in, out) if err != nil { return err } return nil } func (c *MyServicePrioParentClient) Ping() (error) { return c.chClient.Ping(context.Background()) } func (c *MyServicePrioParentClient) PingContext(ctx context.Context) (error) { return c.chClient.Ping(ctx) } func (c *MyServicePrioParentChannelClient) Pong(ctx context.Context) (error) { in := &reqMyServicePrioParentPong{ } out := newRespMyServicePrioParentPong() err := c.ch.Call(ctx, "pong", in, out) if err != nil { return err } return nil } func (c *MyServicePrioParentClient) Pong() (error) { return c.chClient.Pong(context.Background()) } func (c *MyServicePrioParentClient) PongContext(ctx context.Context) (error) { return c.chClient.Pong(ctx) } type reqMyServicePrioParentPing struct { } // Compile time interface enforcer var _ thrift.Struct = &reqMyServicePrioParentPing{} // Deprecated: MyServicePrioParentPingArgsDeprecated is deprecated, since it is supposed to be internal. type MyServicePrioParentPingArgsDeprecated = reqMyServicePrioParentPing func newReqMyServicePrioParentPing() *reqMyServicePrioParentPing { return (&reqMyServicePrioParentPing{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioParentPing().Set().Set() type reqMyServicePrioParentPingBuilder struct { obj *reqMyServicePrioParentPing } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioParentPing().Set().Set() func newReqMyServicePrioParentPingBuilder() *reqMyServicePrioParentPingBuilder { return &reqMyServicePrioParentPingBuilder{ obj: newReqMyServicePrioParentPing(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioParentPing().Set().Set() func (x *reqMyServicePrioParentPingBuilder) Emit() *reqMyServicePrioParentPing { var objCopy reqMyServicePrioParentPing = *x.obj return &objCopy } func (x *reqMyServicePrioParentPing) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServicePrioParentPing"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServicePrioParentPing) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServicePrioParentPing) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServicePrioParentPing({") sb.WriteString("})") return sb.String() } type respMyServicePrioParentPing struct { } // Compile time interface enforcer var _ thrift.Struct = &respMyServicePrioParentPing{} var _ thrift.WritableResult = &respMyServicePrioParentPing{} // Deprecated: MyServicePrioParentPingResultDeprecated is deprecated, since it is supposed to be internal. type MyServicePrioParentPingResultDeprecated = respMyServicePrioParentPing func newRespMyServicePrioParentPing() *respMyServicePrioParentPing { return (&respMyServicePrioParentPing{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioParentPing().Set().Set() type respMyServicePrioParentPingBuilder struct { obj *respMyServicePrioParentPing } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioParentPing().Set().Set() func newRespMyServicePrioParentPingBuilder() *respMyServicePrioParentPingBuilder { return &respMyServicePrioParentPingBuilder{ obj: newRespMyServicePrioParentPing(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioParentPing().Set().Set() func (x *respMyServicePrioParentPingBuilder) Emit() *respMyServicePrioParentPing { var objCopy respMyServicePrioParentPing = *x.obj return &objCopy } func (x *respMyServicePrioParentPing) Exception() thrift.WritableException { return nil } func (x *respMyServicePrioParentPing) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServicePrioParentPing"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServicePrioParentPing) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServicePrioParentPing) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServicePrioParentPing({") sb.WriteString("})") return sb.String() } type reqMyServicePrioParentPong struct { } // Compile time interface enforcer var _ thrift.Struct = &reqMyServicePrioParentPong{} // Deprecated: MyServicePrioParentPongArgsDeprecated is deprecated, since it is supposed to be internal. type MyServicePrioParentPongArgsDeprecated = reqMyServicePrioParentPong func newReqMyServicePrioParentPong() *reqMyServicePrioParentPong { return (&reqMyServicePrioParentPong{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioParentPong().Set().Set() type reqMyServicePrioParentPongBuilder struct { obj *reqMyServicePrioParentPong } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioParentPong().Set().Set() func newReqMyServicePrioParentPongBuilder() *reqMyServicePrioParentPongBuilder { return &reqMyServicePrioParentPongBuilder{ obj: newReqMyServicePrioParentPong(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioParentPong().Set().Set() func (x *reqMyServicePrioParentPongBuilder) Emit() *reqMyServicePrioParentPong { var objCopy reqMyServicePrioParentPong = *x.obj return &objCopy } func (x *reqMyServicePrioParentPong) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServicePrioParentPong"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServicePrioParentPong) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServicePrioParentPong) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServicePrioParentPong({") sb.WriteString("})") return sb.String() } type respMyServicePrioParentPong struct { } // Compile time interface enforcer var _ thrift.Struct = &respMyServicePrioParentPong{} var _ thrift.WritableResult = &respMyServicePrioParentPong{} // Deprecated: MyServicePrioParentPongResultDeprecated is deprecated, since it is supposed to be internal. type MyServicePrioParentPongResultDeprecated = respMyServicePrioParentPong func newRespMyServicePrioParentPong() *respMyServicePrioParentPong { return (&respMyServicePrioParentPong{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioParentPong().Set().Set() type respMyServicePrioParentPongBuilder struct { obj *respMyServicePrioParentPong } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioParentPong().Set().Set() func newRespMyServicePrioParentPongBuilder() *respMyServicePrioParentPongBuilder { return &respMyServicePrioParentPongBuilder{ obj: newRespMyServicePrioParentPong(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioParentPong().Set().Set() func (x *respMyServicePrioParentPongBuilder) Emit() *respMyServicePrioParentPong { var objCopy respMyServicePrioParentPong = *x.obj return &objCopy } func (x *respMyServicePrioParentPong) Exception() thrift.WritableException { return nil } func (x *respMyServicePrioParentPong) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServicePrioParentPong"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServicePrioParentPong) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServicePrioParentPong) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServicePrioParentPong({") sb.WriteString("})") return sb.String() } type MyServicePrioParentProcessor struct { processorMap map[string]thrift.ProcessorFunctionContext functionServiceMap map[string]string handler MyServicePrioParent } // Compile time interface enforcer var _ thrift.ProcessorContext = &MyServicePrioParentProcessor{} func NewMyServicePrioParentProcessor(handler MyServicePrioParent) *MyServicePrioParentProcessor { p := &MyServicePrioParentProcessor{ handler: handler, processorMap: make(map[string]thrift.ProcessorFunctionContext), functionServiceMap: make(map[string]string), } p.AddToProcessorMap("ping", &procFuncMyServicePrioParentPing{handler: handler}) p.AddToProcessorMap("pong", &procFuncMyServicePrioParentPong{handler: handler}) p.AddToFunctionServiceMap("ping", "MyServicePrioParent") p.AddToFunctionServiceMap("pong", "MyServicePrioParent") return p } func (p *MyServicePrioParentProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { p.processorMap[key] = processor } func (p *MyServicePrioParentProcessor) AddToFunctionServiceMap(key, service string) { p.functionServiceMap[key] = service } func (p *MyServicePrioParentProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { if processor, ok := p.processorMap[key]; ok { return processor, nil } return nil, nil } func (p *MyServicePrioParentProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { return p.processorMap } func (p *MyServicePrioParentProcessor) FunctionServiceMap() map[string]string { return p.functionServiceMap } func (p *MyServicePrioParentProcessor) GetThriftMetadata() *metadata.ThriftMetadata { return GetThriftMetadataForService("module.MyServicePrioParent") } type procFuncMyServicePrioParentPing struct { handler MyServicePrioParent } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServicePrioParentPing{} func (p *procFuncMyServicePrioParentPing) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServicePrioParentPing() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServicePrioParentPing) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("ping", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServicePrioParentPing) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespMyServicePrioParentPing() err := p.handler.Ping(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing Ping: " + err.Error(), err) return x, x } return result, nil } type procFuncMyServicePrioParentPong struct { handler MyServicePrioParent } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServicePrioParentPong{} func (p *procFuncMyServicePrioParentPong) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServicePrioParentPong() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServicePrioParentPong) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("pong", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServicePrioParentPong) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespMyServicePrioParentPong() err := p.handler.Pong(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing Pong: " + err.Error(), err) return x, x } return result, nil } type MyServicePrioChild interface { // Inherited/extended service MyServicePrioParent Pang(ctx context.Context) (error) } type MyServicePrioChildChannelClientInterface interface { thrift.ClientInterface MyServicePrioChild } type MyServicePrioChildClientInterface interface { thrift.ClientInterface Pang() (error) } type MyServicePrioChildContextClientInterface interface { MyServicePrioChildClientInterface // Inherited/extended service MyServicePrioParentContextClientInterface PangContext(ctx context.Context) (error) } type MyServicePrioChildChannelClient struct { // Inherited/extended service *MyServicePrioParentChannelClient ch thrift.RequestChannel } // Compile time interface enforcer var _ MyServicePrioChildChannelClientInterface = &MyServicePrioChildChannelClient{} func NewMyServicePrioChildChannelClient(channel thrift.RequestChannel) *MyServicePrioChildChannelClient { return &MyServicePrioChildChannelClient{ MyServicePrioParentChannelClient: NewMyServicePrioParentChannelClient(channel), ch: channel, } } func (c *MyServicePrioChildChannelClient) Close() error { return c.ch.Close() } type MyServicePrioChildClient struct { // Inherited/extended service *MyServicePrioParentClient chClient *MyServicePrioChildChannelClient Mu sync.Mutex } // Compile time interface enforcer var _ MyServicePrioChildClientInterface = &MyServicePrioChildClient{} var _ MyServicePrioChildContextClientInterface = &MyServicePrioChildClient{} func NewMyServicePrioChildClient(prot thrift.Protocol) *MyServicePrioChildClient { return &MyServicePrioChildClient{ MyServicePrioParentClient: NewMyServicePrioParentClient(prot), chClient: NewMyServicePrioChildChannelClient( thrift.NewSerialChannel(prot), ), } } func (c *MyServicePrioChildClient) Close() error { return c.chClient.Close() } func (c *MyServicePrioChildChannelClient) Pang(ctx context.Context) (error) { in := &reqMyServicePrioChildPang{ } out := newRespMyServicePrioChildPang() err := c.ch.Call(ctx, "pang", in, out) if err != nil { return err } return nil } func (c *MyServicePrioChildClient) Pang() (error) { return c.chClient.Pang(context.Background()) } func (c *MyServicePrioChildClient) PangContext(ctx context.Context) (error) { return c.chClient.Pang(ctx) } type reqMyServicePrioChildPang struct { } // Compile time interface enforcer var _ thrift.Struct = &reqMyServicePrioChildPang{} // Deprecated: MyServicePrioChildPangArgsDeprecated is deprecated, since it is supposed to be internal. type MyServicePrioChildPangArgsDeprecated = reqMyServicePrioChildPang func newReqMyServicePrioChildPang() *reqMyServicePrioChildPang { return (&reqMyServicePrioChildPang{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioChildPang().Set().Set() type reqMyServicePrioChildPangBuilder struct { obj *reqMyServicePrioChildPang } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioChildPang().Set().Set() func newReqMyServicePrioChildPangBuilder() *reqMyServicePrioChildPangBuilder { return &reqMyServicePrioChildPangBuilder{ obj: newReqMyServicePrioChildPang(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqMyServicePrioChildPang().Set().Set() func (x *reqMyServicePrioChildPangBuilder) Emit() *reqMyServicePrioChildPang { var objCopy reqMyServicePrioChildPang = *x.obj return &objCopy } func (x *reqMyServicePrioChildPang) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqMyServicePrioChildPang"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqMyServicePrioChildPang) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqMyServicePrioChildPang) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqMyServicePrioChildPang({") sb.WriteString("})") return sb.String() } type respMyServicePrioChildPang struct { } // Compile time interface enforcer var _ thrift.Struct = &respMyServicePrioChildPang{} var _ thrift.WritableResult = &respMyServicePrioChildPang{} // Deprecated: MyServicePrioChildPangResultDeprecated is deprecated, since it is supposed to be internal. type MyServicePrioChildPangResultDeprecated = respMyServicePrioChildPang func newRespMyServicePrioChildPang() *respMyServicePrioChildPang { return (&respMyServicePrioChildPang{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioChildPang().Set().Set() type respMyServicePrioChildPangBuilder struct { obj *respMyServicePrioChildPang } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioChildPang().Set().Set() func newRespMyServicePrioChildPangBuilder() *respMyServicePrioChildPangBuilder { return &respMyServicePrioChildPangBuilder{ obj: newRespMyServicePrioChildPang(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespMyServicePrioChildPang().Set().Set() func (x *respMyServicePrioChildPangBuilder) Emit() *respMyServicePrioChildPang { var objCopy respMyServicePrioChildPang = *x.obj return &objCopy } func (x *respMyServicePrioChildPang) Exception() thrift.WritableException { return nil } func (x *respMyServicePrioChildPang) Write(p thrift.Format) error { if err := p.WriteStructBegin("respMyServicePrioChildPang"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respMyServicePrioChildPang) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respMyServicePrioChildPang) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respMyServicePrioChildPang({") sb.WriteString("})") return sb.String() } type MyServicePrioChildProcessor struct { // Inherited/extended processor *MyServicePrioParentProcessor } // Compile time interface enforcer var _ thrift.ProcessorContext = &MyServicePrioChildProcessor{} func NewMyServicePrioChildProcessor(handler MyServicePrioChild) *MyServicePrioChildProcessor { p := &MyServicePrioChildProcessor{ NewMyServicePrioParentProcessor(handler), } p.AddToProcessorMap("pang", &procFuncMyServicePrioChildPang{handler: handler}) p.AddToFunctionServiceMap("pang", "MyServicePrioChild") return p } func (p *MyServicePrioChildProcessor) GetThriftMetadata() *metadata.ThriftMetadata { return GetThriftMetadataForService("module.MyServicePrioChild") } type procFuncMyServicePrioChildPang struct { handler MyServicePrioChild } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncMyServicePrioChildPang{} func (p *procFuncMyServicePrioChildPang) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqMyServicePrioChildPang() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncMyServicePrioChildPang) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("pang", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncMyServicePrioChildPang) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespMyServicePrioChildPang() err := p.handler.Pang(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing Pang: " + err.Error(), err) return x, x } return result, nil } type BadService interface { Bar(ctx context.Context) (int32, error) } type BadServiceChannelClientInterface interface { thrift.ClientInterface BadService } type BadServiceClientInterface interface { thrift.ClientInterface Bar() (int32, error) } type BadServiceContextClientInterface interface { BadServiceClientInterface BarContext(ctx context.Context) (int32, error) } type BadServiceChannelClient struct { ch thrift.RequestChannel } // Compile time interface enforcer var _ BadServiceChannelClientInterface = &BadServiceChannelClient{} func NewBadServiceChannelClient(channel thrift.RequestChannel) *BadServiceChannelClient { return &BadServiceChannelClient{ ch: channel, } } func (c *BadServiceChannelClient) Close() error { return c.ch.Close() } type BadServiceClient struct { chClient *BadServiceChannelClient Mu sync.Mutex } // Compile time interface enforcer var _ BadServiceClientInterface = &BadServiceClient{} var _ BadServiceContextClientInterface = &BadServiceClient{} func NewBadServiceClient(prot thrift.Protocol) *BadServiceClient { return &BadServiceClient{ chClient: NewBadServiceChannelClient( thrift.NewSerialChannel(prot), ), } } func (c *BadServiceClient) Close() error { return c.chClient.Close() } func (c *BadServiceChannelClient) Bar(ctx context.Context) (int32, error) { in := &reqBadServiceBar{ } out := newRespBadServiceBar() err := c.ch.Call(ctx, "bar", in, out) if err != nil { return 0, err } return out.GetSuccess(), nil } func (c *BadServiceClient) Bar() (int32, error) { return c.chClient.Bar(context.Background()) } func (c *BadServiceClient) BarContext(ctx context.Context) (int32, error) { return c.chClient.Bar(ctx) } type reqBadServiceBar struct { } // Compile time interface enforcer var _ thrift.Struct = &reqBadServiceBar{} // Deprecated: BadServiceBarArgsDeprecated is deprecated, since it is supposed to be internal. type BadServiceBarArgsDeprecated = reqBadServiceBar func newReqBadServiceBar() *reqBadServiceBar { return (&reqBadServiceBar{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqBadServiceBar().Set().Set() type reqBadServiceBarBuilder struct { obj *reqBadServiceBar } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqBadServiceBar().Set().Set() func newReqBadServiceBarBuilder() *reqBadServiceBarBuilder { return &reqBadServiceBarBuilder{ obj: newReqBadServiceBar(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqBadServiceBar().Set().Set() func (x *reqBadServiceBarBuilder) Emit() *reqBadServiceBar { var objCopy reqBadServiceBar = *x.obj return &objCopy } func (x *reqBadServiceBar) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqBadServiceBar"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqBadServiceBar) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqBadServiceBar) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqBadServiceBar({") sb.WriteString("})") return sb.String() } type respBadServiceBar struct { Success *int32 `thrift:"success,0,optional" json:"success,omitempty" db:"success"` } // Compile time interface enforcer var _ thrift.Struct = &respBadServiceBar{} var _ thrift.WritableResult = &respBadServiceBar{} // Deprecated: BadServiceBarResultDeprecated is deprecated, since it is supposed to be internal. type BadServiceBarResultDeprecated = respBadServiceBar func newRespBadServiceBar() *respBadServiceBar { return (&respBadServiceBar{}) } func (x *respBadServiceBar) GetSuccessNonCompat() *int32 { return x.Success } func (x *respBadServiceBar) GetSuccess() int32 { if !x.IsSetSuccess() { return 0 } return *x.Success } func (x *respBadServiceBar) SetSuccessNonCompat(value int32) *respBadServiceBar { x.Success = &value return x } func (x *respBadServiceBar) SetSuccess(value *int32) *respBadServiceBar { x.Success = value return x } func (x *respBadServiceBar) IsSetSuccess() bool { return x != nil && x.Success != nil } func (x *respBadServiceBar) writeField0(p thrift.Format) error { // Success if !x.IsSetSuccess() { return nil } if err := p.WriteFieldBegin("success", thrift.I32, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := *x.GetSuccessNonCompat() if err := p.WriteI32(item); err != nil { return err } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *respBadServiceBar) readField0(p thrift.Format) error { // Success result, err := p.ReadI32() if err != nil { return err } x.SetSuccessNonCompat(result) return nil } func (x *respBadServiceBar) toString0() string { // Success if x.IsSetSuccess() { return fmt.Sprintf("%v", *x.GetSuccessNonCompat()) } return fmt.Sprintf("%v", x.GetSuccessNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespBadServiceBar().Set().Set() type respBadServiceBarBuilder struct { obj *respBadServiceBar } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespBadServiceBar().Set().Set() func newRespBadServiceBarBuilder() *respBadServiceBarBuilder { return &respBadServiceBarBuilder{ obj: newRespBadServiceBar(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespBadServiceBar().Set().Set() func (x *respBadServiceBarBuilder) Success(value *int32) *respBadServiceBarBuilder { x.obj.Success = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespBadServiceBar().Set().Set() func (x *respBadServiceBarBuilder) Emit() *respBadServiceBar { var objCopy respBadServiceBar = *x.obj return &objCopy } func (x *respBadServiceBar) Exception() thrift.WritableException { return nil } func (x *respBadServiceBar) Write(p thrift.Format) error { if err := p.WriteStructBegin("respBadServiceBar"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField0(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respBadServiceBar) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 0 && wireType == thrift.Type(thrift.I32)): // success if err := x.readField0(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respBadServiceBar) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respBadServiceBar({") sb.WriteString(fmt.Sprintf("Success:%s", x.toString0())) sb.WriteString("})") return sb.String() } type BadServiceProcessor struct { processorMap map[string]thrift.ProcessorFunctionContext functionServiceMap map[string]string handler BadService } // Compile time interface enforcer var _ thrift.ProcessorContext = &BadServiceProcessor{} func NewBadServiceProcessor(handler BadService) *BadServiceProcessor { p := &BadServiceProcessor{ handler: handler, processorMap: make(map[string]thrift.ProcessorFunctionContext), functionServiceMap: make(map[string]string), } p.AddToProcessorMap("bar", &procFuncBadServiceBar{handler: handler}) p.AddToFunctionServiceMap("bar", "BadService") return p } func (p *BadServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { p.processorMap[key] = processor } func (p *BadServiceProcessor) AddToFunctionServiceMap(key, service string) { p.functionServiceMap[key] = service } func (p *BadServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { if processor, ok := p.processorMap[key]; ok { return processor, nil } return nil, nil } func (p *BadServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { return p.processorMap } func (p *BadServiceProcessor) FunctionServiceMap() map[string]string { return p.functionServiceMap } func (p *BadServiceProcessor) GetThriftMetadata() *metadata.ThriftMetadata { return GetThriftMetadataForService("module.BadService") } type procFuncBadServiceBar struct { handler BadService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncBadServiceBar{} func (p *procFuncBadServiceBar) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqBadServiceBar() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncBadServiceBar) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("bar", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncBadServiceBar) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespBadServiceBar() retval, err := p.handler.Bar(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing Bar: " + err.Error(), err) return x, x } result.Success = &retval return result, nil } type FooBarBazService interface { FooStructured(ctx context.Context) (error) BarNonStructured(ctx context.Context) (error) Baz(ctx context.Context) (error) } type FooBarBazServiceChannelClientInterface interface { thrift.ClientInterface FooBarBazService } type FooBarBazServiceClientInterface interface { thrift.ClientInterface FooStructured() (error) BarNonStructured() (error) Baz() (error) } type FooBarBazServiceContextClientInterface interface { FooBarBazServiceClientInterface FooStructuredContext(ctx context.Context) (error) BarNonStructuredContext(ctx context.Context) (error) BazContext(ctx context.Context) (error) } type FooBarBazServiceChannelClient struct { ch thrift.RequestChannel } // Compile time interface enforcer var _ FooBarBazServiceChannelClientInterface = &FooBarBazServiceChannelClient{} func NewFooBarBazServiceChannelClient(channel thrift.RequestChannel) *FooBarBazServiceChannelClient { return &FooBarBazServiceChannelClient{ ch: channel, } } func (c *FooBarBazServiceChannelClient) Close() error { return c.ch.Close() } type FooBarBazServiceClient struct { chClient *FooBarBazServiceChannelClient Mu sync.Mutex } // Compile time interface enforcer var _ FooBarBazServiceClientInterface = &FooBarBazServiceClient{} var _ FooBarBazServiceContextClientInterface = &FooBarBazServiceClient{} func NewFooBarBazServiceClient(prot thrift.Protocol) *FooBarBazServiceClient { return &FooBarBazServiceClient{ chClient: NewFooBarBazServiceChannelClient( thrift.NewSerialChannel(prot), ), } } func (c *FooBarBazServiceClient) Close() error { return c.chClient.Close() } func (c *FooBarBazServiceChannelClient) FooStructured(ctx context.Context) (error) { in := &reqFooBarBazServiceFooStructured{ } out := newRespFooBarBazServiceFooStructured() err := c.ch.Call(ctx, "foo", in, out) if err != nil { return err } return nil } func (c *FooBarBazServiceClient) FooStructured() (error) { return c.chClient.FooStructured(context.Background()) } func (c *FooBarBazServiceClient) FooStructuredContext(ctx context.Context) (error) { return c.chClient.FooStructured(ctx) } func (c *FooBarBazServiceChannelClient) BarNonStructured(ctx context.Context) (error) { in := &reqFooBarBazServiceBarNonStructured{ } out := newRespFooBarBazServiceBarNonStructured() err := c.ch.Call(ctx, "bar", in, out) if err != nil { return err } return nil } func (c *FooBarBazServiceClient) BarNonStructured() (error) { return c.chClient.BarNonStructured(context.Background()) } func (c *FooBarBazServiceClient) BarNonStructuredContext(ctx context.Context) (error) { return c.chClient.BarNonStructured(ctx) } func (c *FooBarBazServiceChannelClient) Baz(ctx context.Context) (error) { in := &reqFooBarBazServiceBaz{ } out := newRespFooBarBazServiceBaz() err := c.ch.Call(ctx, "baz", in, out) if err != nil { return err } return nil } func (c *FooBarBazServiceClient) Baz() (error) { return c.chClient.Baz(context.Background()) } func (c *FooBarBazServiceClient) BazContext(ctx context.Context) (error) { return c.chClient.Baz(ctx) } type reqFooBarBazServiceFooStructured struct { } // Compile time interface enforcer var _ thrift.Struct = &reqFooBarBazServiceFooStructured{} // Deprecated: FooBarBazServiceFooStructuredArgsDeprecated is deprecated, since it is supposed to be internal. type FooBarBazServiceFooStructuredArgsDeprecated = reqFooBarBazServiceFooStructured func newReqFooBarBazServiceFooStructured() *reqFooBarBazServiceFooStructured { return (&reqFooBarBazServiceFooStructured{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceFooStructured().Set().Set() type reqFooBarBazServiceFooStructuredBuilder struct { obj *reqFooBarBazServiceFooStructured } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceFooStructured().Set().Set() func newReqFooBarBazServiceFooStructuredBuilder() *reqFooBarBazServiceFooStructuredBuilder { return &reqFooBarBazServiceFooStructuredBuilder{ obj: newReqFooBarBazServiceFooStructured(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceFooStructured().Set().Set() func (x *reqFooBarBazServiceFooStructuredBuilder) Emit() *reqFooBarBazServiceFooStructured { var objCopy reqFooBarBazServiceFooStructured = *x.obj return &objCopy } func (x *reqFooBarBazServiceFooStructured) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqFooBarBazServiceFooStructured"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqFooBarBazServiceFooStructured) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqFooBarBazServiceFooStructured) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqFooBarBazServiceFooStructured({") sb.WriteString("})") return sb.String() } type respFooBarBazServiceFooStructured struct { } // Compile time interface enforcer var _ thrift.Struct = &respFooBarBazServiceFooStructured{} var _ thrift.WritableResult = &respFooBarBazServiceFooStructured{} // Deprecated: FooBarBazServiceFooStructuredResultDeprecated is deprecated, since it is supposed to be internal. type FooBarBazServiceFooStructuredResultDeprecated = respFooBarBazServiceFooStructured func newRespFooBarBazServiceFooStructured() *respFooBarBazServiceFooStructured { return (&respFooBarBazServiceFooStructured{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceFooStructured().Set().Set() type respFooBarBazServiceFooStructuredBuilder struct { obj *respFooBarBazServiceFooStructured } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceFooStructured().Set().Set() func newRespFooBarBazServiceFooStructuredBuilder() *respFooBarBazServiceFooStructuredBuilder { return &respFooBarBazServiceFooStructuredBuilder{ obj: newRespFooBarBazServiceFooStructured(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceFooStructured().Set().Set() func (x *respFooBarBazServiceFooStructuredBuilder) Emit() *respFooBarBazServiceFooStructured { var objCopy respFooBarBazServiceFooStructured = *x.obj return &objCopy } func (x *respFooBarBazServiceFooStructured) Exception() thrift.WritableException { return nil } func (x *respFooBarBazServiceFooStructured) Write(p thrift.Format) error { if err := p.WriteStructBegin("respFooBarBazServiceFooStructured"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respFooBarBazServiceFooStructured) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respFooBarBazServiceFooStructured) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respFooBarBazServiceFooStructured({") sb.WriteString("})") return sb.String() } type reqFooBarBazServiceBarNonStructured struct { } // Compile time interface enforcer var _ thrift.Struct = &reqFooBarBazServiceBarNonStructured{} // Deprecated: FooBarBazServiceBarNonStructuredArgsDeprecated is deprecated, since it is supposed to be internal. type FooBarBazServiceBarNonStructuredArgsDeprecated = reqFooBarBazServiceBarNonStructured func newReqFooBarBazServiceBarNonStructured() *reqFooBarBazServiceBarNonStructured { return (&reqFooBarBazServiceBarNonStructured{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceBarNonStructured().Set().Set() type reqFooBarBazServiceBarNonStructuredBuilder struct { obj *reqFooBarBazServiceBarNonStructured } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceBarNonStructured().Set().Set() func newReqFooBarBazServiceBarNonStructuredBuilder() *reqFooBarBazServiceBarNonStructuredBuilder { return &reqFooBarBazServiceBarNonStructuredBuilder{ obj: newReqFooBarBazServiceBarNonStructured(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceBarNonStructured().Set().Set() func (x *reqFooBarBazServiceBarNonStructuredBuilder) Emit() *reqFooBarBazServiceBarNonStructured { var objCopy reqFooBarBazServiceBarNonStructured = *x.obj return &objCopy } func (x *reqFooBarBazServiceBarNonStructured) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqFooBarBazServiceBarNonStructured"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqFooBarBazServiceBarNonStructured) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqFooBarBazServiceBarNonStructured) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqFooBarBazServiceBarNonStructured({") sb.WriteString("})") return sb.String() } type respFooBarBazServiceBarNonStructured struct { } // Compile time interface enforcer var _ thrift.Struct = &respFooBarBazServiceBarNonStructured{} var _ thrift.WritableResult = &respFooBarBazServiceBarNonStructured{} // Deprecated: FooBarBazServiceBarNonStructuredResultDeprecated is deprecated, since it is supposed to be internal. type FooBarBazServiceBarNonStructuredResultDeprecated = respFooBarBazServiceBarNonStructured func newRespFooBarBazServiceBarNonStructured() *respFooBarBazServiceBarNonStructured { return (&respFooBarBazServiceBarNonStructured{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceBarNonStructured().Set().Set() type respFooBarBazServiceBarNonStructuredBuilder struct { obj *respFooBarBazServiceBarNonStructured } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceBarNonStructured().Set().Set() func newRespFooBarBazServiceBarNonStructuredBuilder() *respFooBarBazServiceBarNonStructuredBuilder { return &respFooBarBazServiceBarNonStructuredBuilder{ obj: newRespFooBarBazServiceBarNonStructured(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceBarNonStructured().Set().Set() func (x *respFooBarBazServiceBarNonStructuredBuilder) Emit() *respFooBarBazServiceBarNonStructured { var objCopy respFooBarBazServiceBarNonStructured = *x.obj return &objCopy } func (x *respFooBarBazServiceBarNonStructured) Exception() thrift.WritableException { return nil } func (x *respFooBarBazServiceBarNonStructured) Write(p thrift.Format) error { if err := p.WriteStructBegin("respFooBarBazServiceBarNonStructured"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respFooBarBazServiceBarNonStructured) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respFooBarBazServiceBarNonStructured) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respFooBarBazServiceBarNonStructured({") sb.WriteString("})") return sb.String() } type reqFooBarBazServiceBaz struct { } // Compile time interface enforcer var _ thrift.Struct = &reqFooBarBazServiceBaz{} // Deprecated: FooBarBazServiceBazArgsDeprecated is deprecated, since it is supposed to be internal. type FooBarBazServiceBazArgsDeprecated = reqFooBarBazServiceBaz func newReqFooBarBazServiceBaz() *reqFooBarBazServiceBaz { return (&reqFooBarBazServiceBaz{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceBaz().Set().Set() type reqFooBarBazServiceBazBuilder struct { obj *reqFooBarBazServiceBaz } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceBaz().Set().Set() func newReqFooBarBazServiceBazBuilder() *reqFooBarBazServiceBazBuilder { return &reqFooBarBazServiceBazBuilder{ obj: newReqFooBarBazServiceBaz(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqFooBarBazServiceBaz().Set().Set() func (x *reqFooBarBazServiceBazBuilder) Emit() *reqFooBarBazServiceBaz { var objCopy reqFooBarBazServiceBaz = *x.obj return &objCopy } func (x *reqFooBarBazServiceBaz) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqFooBarBazServiceBaz"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqFooBarBazServiceBaz) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqFooBarBazServiceBaz) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqFooBarBazServiceBaz({") sb.WriteString("})") return sb.String() } type respFooBarBazServiceBaz struct { } // Compile time interface enforcer var _ thrift.Struct = &respFooBarBazServiceBaz{} var _ thrift.WritableResult = &respFooBarBazServiceBaz{} // Deprecated: FooBarBazServiceBazResultDeprecated is deprecated, since it is supposed to be internal. type FooBarBazServiceBazResultDeprecated = respFooBarBazServiceBaz func newRespFooBarBazServiceBaz() *respFooBarBazServiceBaz { return (&respFooBarBazServiceBaz{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceBaz().Set().Set() type respFooBarBazServiceBazBuilder struct { obj *respFooBarBazServiceBaz } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceBaz().Set().Set() func newRespFooBarBazServiceBazBuilder() *respFooBarBazServiceBazBuilder { return &respFooBarBazServiceBazBuilder{ obj: newRespFooBarBazServiceBaz(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespFooBarBazServiceBaz().Set().Set() func (x *respFooBarBazServiceBazBuilder) Emit() *respFooBarBazServiceBaz { var objCopy respFooBarBazServiceBaz = *x.obj return &objCopy } func (x *respFooBarBazServiceBaz) Exception() thrift.WritableException { return nil } func (x *respFooBarBazServiceBaz) Write(p thrift.Format) error { if err := p.WriteStructBegin("respFooBarBazServiceBaz"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respFooBarBazServiceBaz) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respFooBarBazServiceBaz) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respFooBarBazServiceBaz({") sb.WriteString("})") return sb.String() } type FooBarBazServiceProcessor struct { processorMap map[string]thrift.ProcessorFunctionContext functionServiceMap map[string]string handler FooBarBazService } // Compile time interface enforcer var _ thrift.ProcessorContext = &FooBarBazServiceProcessor{} func NewFooBarBazServiceProcessor(handler FooBarBazService) *FooBarBazServiceProcessor { p := &FooBarBazServiceProcessor{ handler: handler, processorMap: make(map[string]thrift.ProcessorFunctionContext), functionServiceMap: make(map[string]string), } p.AddToProcessorMap("foo", &procFuncFooBarBazServiceFooStructured{handler: handler}) p.AddToProcessorMap("bar", &procFuncFooBarBazServiceBarNonStructured{handler: handler}) p.AddToProcessorMap("baz", &procFuncFooBarBazServiceBaz{handler: handler}) p.AddToFunctionServiceMap("foo", "FooBarBazService") p.AddToFunctionServiceMap("bar", "FooBarBazService") p.AddToFunctionServiceMap("baz", "FooBarBazService") return p } func (p *FooBarBazServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { p.processorMap[key] = processor } func (p *FooBarBazServiceProcessor) AddToFunctionServiceMap(key, service string) { p.functionServiceMap[key] = service } func (p *FooBarBazServiceProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { if processor, ok := p.processorMap[key]; ok { return processor, nil } return nil, nil } func (p *FooBarBazServiceProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { return p.processorMap } func (p *FooBarBazServiceProcessor) FunctionServiceMap() map[string]string { return p.functionServiceMap } func (p *FooBarBazServiceProcessor) GetThriftMetadata() *metadata.ThriftMetadata { return GetThriftMetadataForService("module.FooBarBazService") } type procFuncFooBarBazServiceFooStructured struct { handler FooBarBazService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncFooBarBazServiceFooStructured{} func (p *procFuncFooBarBazServiceFooStructured) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqFooBarBazServiceFooStructured() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncFooBarBazServiceFooStructured) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("foo", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncFooBarBazServiceFooStructured) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespFooBarBazServiceFooStructured() err := p.handler.FooStructured(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing FooStructured: " + err.Error(), err) return x, x } return result, nil } type procFuncFooBarBazServiceBarNonStructured struct { handler FooBarBazService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncFooBarBazServiceBarNonStructured{} func (p *procFuncFooBarBazServiceBarNonStructured) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqFooBarBazServiceBarNonStructured() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncFooBarBazServiceBarNonStructured) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("bar", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncFooBarBazServiceBarNonStructured) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespFooBarBazServiceBarNonStructured() err := p.handler.BarNonStructured(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing BarNonStructured: " + err.Error(), err) return x, x } return result, nil } type procFuncFooBarBazServiceBaz struct { handler FooBarBazService } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncFooBarBazServiceBaz{} func (p *procFuncFooBarBazServiceBaz) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqFooBarBazServiceBaz() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncFooBarBazServiceBaz) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("baz", messageType, 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(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncFooBarBazServiceBaz) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { result := newRespFooBarBazServiceBaz() err := p.handler.Baz(ctx) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing Baz: " + err.Error(), err) return x, x } return result, nil }