Skip to content

Commit 54e3b77

Browse files
echistyakovfacebook-github-bot
authored andcommitted
Remove deprecated ContextClientInterface
Summary: Interface serves no useful purpose. #build_rule_type[go_library,go_binary,go_unittest,go_test] Reviewed By: leoleovich Differential Revision: D68877382 fbshipit-source-id: 8f8eeca2565c95ebca55518a796c425c3890cce5
1 parent 03719f3 commit 54e3b77

File tree

23 files changed

+0
-298
lines changed
  • thrift/compiler
    • generate/templates/go/svc
    • test/fixtures
      • adapter/out/go/gen-go/module
      • basic/out/go/gen-go/module
      • basic-annotations/out/go/gen-go/module
      • doctext/out/go/gen-go/module
      • exceptions/out/go/gen-go/module
      • go-service/out/go/gen-go/module
      • go-typedef/out/go_module1/gen-go/module1
      • includes/out/go_service/gen-go/service
      • inheritance/out/go/gen-go/module
      • interactions/out/go/gen-go
      • namespace/out
        • go/gen-go/my/namespacing/test/module
        • go_emptyns/gen-go/emptyns
        • go_extend/gen-go/my/namespacing
        • go_hsmodule/gen-go/my/namespacing/test
        • go_quoted/gen-go/my/namespacing/test/module
      • namespace_from_package/out/go/gen-go/namespace_from_package/module
      • namespace_from_package_without_module_name/out/go/gen-go/namespace_from_package_without_module_name/module
      • params/out/go/gen-go/module
      • types/out/go/gen-go/module

23 files changed

+0
-298
lines changed

thrift/compiler/generate/templates/go/svc/client.mustache

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ type {{service:go_name}}Client struct {
5757
}
5858
// Compile time interface enforcer
5959
var _ {{service:go_name}}ClientInterface = (*{{service:go_name}}Client)(nil)
60-
var _ {{service:go_name}}ContextClientInterface = (*{{service:go_name}}Client)(nil)
6160

6261
func New{{service:go_name}}Client(prot thrift.Protocol) *{{service:go_name}}Client {
6362
return &{{service:go_name}}Client{

thrift/compiler/generate/templates/go/svc/interface.mustache

-24
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,4 @@ type {{service:go_name}}ClientInterface interface {
5151
{{/function:go_supported?}}
5252
{{/service:functions}}
5353
}
54-
55-
{{!COMPAT: backwards compatibility
56-
Currently there are a bunch of use cases that implement ClientInterface without Context functions.
57-
1. We need to manually move them over to ContextClientInterface
58-
2. Add func_signature_with_ctx to ClientInterface
59-
3. Move them back to ClientInterface
60-
4. Delete ContextClientInterface
61-
}}{{!
62-
}}type {{service:go_name}}ContextClientInterface interface {
63-
{{service:go_name}}ClientInterface
64-
{{#service:extends?}}
65-
{{#service:extends}}
66-
// Inherited/extended service
67-
{{service:go_qualified_name}}ContextClientInterface
68-
69-
{{/service:extends}}
70-
{{/service:extends?}}
71-
{{#service:functions}}
72-
{{#function:go_supported?}}
73-
{{> svc/func_signature_with_ctx}}
74-
75-
{{/function:go_supported?}}
76-
{{/service:functions}}
77-
}
7854
{{! new line }}

thrift/compiler/test/fixtures/adapter/out/go/gen-go/module/svcs.go

-13
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ type ServiceClientInterface interface {
3636
Func(arg1 StringWithAdapter_7208, arg2 string, arg3 *Foo) (MyI32_4873, error)
3737
}
3838

39-
type ServiceContextClientInterface interface {
40-
ServiceClientInterface
41-
FuncContext(ctx context.Context, arg1 StringWithAdapter_7208, arg2 string, arg3 *Foo) (MyI32_4873, error)
42-
}
43-
4439
type ServiceChannelClient struct {
4540
ch thrift.RequestChannel
4641
}
@@ -62,7 +57,6 @@ type ServiceClient struct {
6257
}
6358
// Compile time interface enforcer
6459
var _ ServiceClientInterface = (*ServiceClient)(nil)
65-
var _ ServiceContextClientInterface = (*ServiceClient)(nil)
6660

6761
func NewServiceClient(prot thrift.Protocol) *ServiceClient {
6862
return &ServiceClient{
@@ -214,12 +208,6 @@ type AdapterServiceClientInterface interface {
214208
AdaptedTypes(arg *HeapAllocated) (*HeapAllocated, error)
215209
}
216210

217-
type AdapterServiceContextClientInterface interface {
218-
AdapterServiceClientInterface
219-
CountContext(ctx context.Context) (*CountingStruct, error)
220-
AdaptedTypesContext(ctx context.Context, arg *HeapAllocated) (*HeapAllocated, error)
221-
}
222-
223211
type AdapterServiceChannelClient struct {
224212
ch thrift.RequestChannel
225213
}
@@ -241,7 +229,6 @@ type AdapterServiceClient struct {
241229
}
242230
// Compile time interface enforcer
243231
var _ AdapterServiceClientInterface = (*AdapterServiceClient)(nil)
244-
var _ AdapterServiceContextClientInterface = (*AdapterServiceClient)(nil)
245232

246233
func NewAdapterServiceClient(prot thrift.Protocol) *AdapterServiceClient {
247234
return &AdapterServiceClient{

thrift/compiler/test/fixtures/basic-annotations/out/go/gen-go/module/svcs.go

-42
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,6 @@ type MyServiceClientInterface interface {
4848
GoDoNothing() (error)
4949
}
5050

51-
type MyServiceContextClientInterface interface {
52-
MyServiceClientInterface
53-
PingContext(ctx context.Context) (error)
54-
GetRandomDataContext(ctx context.Context) (string, error)
55-
HasDataByIdContext(ctx context.Context, id int64) (bool, error)
56-
GoGetDataByIdContext(ctx context.Context, id int64) (string, error)
57-
PutDataByIdContext(ctx context.Context, id int64, data string) (error)
58-
LobDataByIdContext(ctx context.Context, id int64, data string) (error)
59-
GoDoNothingContext(ctx context.Context) (error)
60-
}
61-
6251
type MyServiceChannelClient struct {
6352
ch thrift.RequestChannel
6453
}
@@ -80,7 +69,6 @@ type MyServiceClient struct {
8069
}
8170
// Compile time interface enforcer
8271
var _ MyServiceClientInterface = (*MyServiceClient)(nil)
83-
var _ MyServiceContextClientInterface = (*MyServiceClient)(nil)
8472

8573
func NewMyServiceClient(prot thrift.Protocol) *MyServiceClient {
8674
return &MyServiceClient{
@@ -672,12 +660,6 @@ type MyServicePrioParentClientInterface interface {
672660
Pong() (error)
673661
}
674662

675-
type MyServicePrioParentContextClientInterface interface {
676-
MyServicePrioParentClientInterface
677-
PingContext(ctx context.Context) (error)
678-
PongContext(ctx context.Context) (error)
679-
}
680-
681663
type MyServicePrioParentChannelClient struct {
682664
ch thrift.RequestChannel
683665
}
@@ -699,7 +681,6 @@ type MyServicePrioParentClient struct {
699681
}
700682
// Compile time interface enforcer
701683
var _ MyServicePrioParentClientInterface = (*MyServicePrioParentClient)(nil)
702-
var _ MyServicePrioParentContextClientInterface = (*MyServicePrioParentClient)(nil)
703684

704685
func NewMyServicePrioParentClient(prot thrift.Protocol) *MyServicePrioParentClient {
705686
return &MyServicePrioParentClient{
@@ -921,14 +902,6 @@ type MyServicePrioChildClientInterface interface {
921902
Pang() (error)
922903
}
923904

924-
type MyServicePrioChildContextClientInterface interface {
925-
MyServicePrioChildClientInterface
926-
// Inherited/extended service
927-
MyServicePrioParentContextClientInterface
928-
929-
PangContext(ctx context.Context) (error)
930-
}
931-
932905
type MyServicePrioChildChannelClient struct {
933906
// Inherited/extended service
934907
*MyServicePrioParentChannelClient
@@ -955,7 +928,6 @@ type MyServicePrioChildClient struct {
955928
}
956929
// Compile time interface enforcer
957930
var _ MyServicePrioChildClientInterface = (*MyServicePrioChildClient)(nil)
958-
var _ MyServicePrioChildContextClientInterface = (*MyServicePrioChildClient)(nil)
959931

960932
func NewMyServicePrioChildClient(prot thrift.Protocol) *MyServicePrioChildClient {
961933
return &MyServicePrioChildClient{
@@ -1074,11 +1046,6 @@ type BadServiceClientInterface interface {
10741046
Bar() (int32, error)
10751047
}
10761048

1077-
type BadServiceContextClientInterface interface {
1078-
BadServiceClientInterface
1079-
BarContext(ctx context.Context) (int32, error)
1080-
}
1081-
10821049
type BadServiceChannelClient struct {
10831050
ch thrift.RequestChannel
10841051
}
@@ -1100,7 +1067,6 @@ type BadServiceClient struct {
11001067
}
11011068
// Compile time interface enforcer
11021069
var _ BadServiceClientInterface = (*BadServiceClient)(nil)
1103-
var _ BadServiceContextClientInterface = (*BadServiceClient)(nil)
11041070

11051071
func NewBadServiceClient(prot thrift.Protocol) *BadServiceClient {
11061072
return &BadServiceClient{
@@ -1250,13 +1216,6 @@ type FooBarBazServiceClientInterface interface {
12501216
Baz() (error)
12511217
}
12521218

1253-
type FooBarBazServiceContextClientInterface interface {
1254-
FooBarBazServiceClientInterface
1255-
FooStructuredContext(ctx context.Context) (error)
1256-
BarNonStructuredContext(ctx context.Context) (error)
1257-
BazContext(ctx context.Context) (error)
1258-
}
1259-
12601219
type FooBarBazServiceChannelClient struct {
12611220
ch thrift.RequestChannel
12621221
}
@@ -1278,7 +1237,6 @@ type FooBarBazServiceClient struct {
12781237
}
12791238
// Compile time interface enforcer
12801239
var _ FooBarBazServiceClientInterface = (*FooBarBazServiceClient)(nil)
1281-
var _ FooBarBazServiceContextClientInterface = (*FooBarBazServiceClient)(nil)
12821240

12831241
func NewFooBarBazServiceClient(prot thrift.Protocol) *FooBarBazServiceClient {
12841242
return &FooBarBazServiceClient{

thrift/compiler/test/fixtures/basic/out/go/gen-go/module/svcs.go

-34
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ type FooServiceClientInterface interface {
3636
SimpleRPC() (error)
3737
}
3838

39-
type FooServiceContextClientInterface interface {
40-
FooServiceClientInterface
41-
SimpleRPCContext(ctx context.Context) (error)
42-
}
43-
4439
type FooServiceChannelClient struct {
4540
ch thrift.RequestChannel
4641
}
@@ -62,7 +57,6 @@ type FooServiceClient struct {
6257
}
6358
// Compile time interface enforcer
6459
var _ FooServiceClientInterface = (*FooServiceClient)(nil)
65-
var _ FooServiceContextClientInterface = (*FooServiceClient)(nil)
6660

6761
func NewFooServiceClient(prot thrift.Protocol) *FooServiceClient {
6862
return &FooServiceClient{
@@ -207,11 +201,6 @@ type FB303ServiceClientInterface interface {
207201
SimpleRPC(intParameter int32) (*ReservedKeyword, error)
208202
}
209203

210-
type FB303ServiceContextClientInterface interface {
211-
FB303ServiceClientInterface
212-
SimpleRPCContext(ctx context.Context, intParameter int32) (*ReservedKeyword, error)
213-
}
214-
215204
type FB303ServiceChannelClient struct {
216205
ch thrift.RequestChannel
217206
}
@@ -233,7 +222,6 @@ type FB303ServiceClient struct {
233222
}
234223
// Compile time interface enforcer
235224
var _ FB303ServiceClientInterface = (*FB303ServiceClient)(nil)
236-
var _ FB303ServiceContextClientInterface = (*FB303ServiceClient)(nil)
237225

238226
func NewFB303ServiceClient(prot thrift.Protocol) *FB303ServiceClient {
239227
return &FB303ServiceClient{
@@ -399,20 +387,6 @@ type MyServiceClientInterface interface {
399387
RpcSkippedCodegen() (error)
400388
}
401389

402-
type MyServiceContextClientInterface interface {
403-
MyServiceClientInterface
404-
PingContext(ctx context.Context) (error)
405-
GetRandomDataContext(ctx context.Context) (string, error)
406-
SinkContext(ctx context.Context, sink int64) (error)
407-
PutDataByIdContext(ctx context.Context, id int64, data string) (error)
408-
HasDataByIdContext(ctx context.Context, id int64) (bool, error)
409-
GetDataByIdContext(ctx context.Context, id int64) (string, error)
410-
DeleteDataByIdContext(ctx context.Context, id int64) (error)
411-
LobDataByIdContext(ctx context.Context, id int64, data string) (error)
412-
InvalidReturnForHackContext(ctx context.Context) ([]float32, error)
413-
RpcSkippedCodegenContext(ctx context.Context) (error)
414-
}
415-
416390
type MyServiceChannelClient struct {
417391
ch thrift.RequestChannel
418392
}
@@ -434,7 +408,6 @@ type MyServiceClient struct {
434408
}
435409
// Compile time interface enforcer
436410
var _ MyServiceClientInterface = (*MyServiceClient)(nil)
437-
var _ MyServiceContextClientInterface = (*MyServiceClient)(nil)
438411

439412
func NewMyServiceClient(prot thrift.Protocol) *MyServiceClient {
440413
return &MyServiceClient{
@@ -1232,12 +1205,6 @@ type DbMixedStackArgumentsClientInterface interface {
12321205
GetDataByKey1(key string) ([]byte, error)
12331206
}
12341207

1235-
type DbMixedStackArgumentsContextClientInterface interface {
1236-
DbMixedStackArgumentsClientInterface
1237-
GetDataByKey0Context(ctx context.Context, key string) ([]byte, error)
1238-
GetDataByKey1Context(ctx context.Context, key string) ([]byte, error)
1239-
}
1240-
12411208
type DbMixedStackArgumentsChannelClient struct {
12421209
ch thrift.RequestChannel
12431210
}
@@ -1259,7 +1226,6 @@ type DbMixedStackArgumentsClient struct {
12591226
}
12601227
// Compile time interface enforcer
12611228
var _ DbMixedStackArgumentsClientInterface = (*DbMixedStackArgumentsClient)(nil)
1262-
var _ DbMixedStackArgumentsContextClientInterface = (*DbMixedStackArgumentsClient)(nil)
12631229

12641230
func NewDbMixedStackArgumentsClient(prot thrift.Protocol) *DbMixedStackArgumentsClient {
12651231
return &DbMixedStackArgumentsClient{

thrift/compiler/test/fixtures/doctext/out/go/gen-go/module/svcs.go

-7
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ type CClientInterface interface {
3838
Thing(a int32, b string, c []int32) (string, error)
3939
}
4040

41-
type CContextClientInterface interface {
42-
CClientInterface
43-
FContext(ctx context.Context) (error)
44-
ThingContext(ctx context.Context, a int32, b string, c []int32) (string, error)
45-
}
46-
4741
type CChannelClient struct {
4842
ch thrift.RequestChannel
4943
}
@@ -65,7 +59,6 @@ type CClient struct {
6559
}
6660
// Compile time interface enforcer
6761
var _ CClientInterface = (*CClient)(nil)
68-
var _ CContextClientInterface = (*CClient)(nil)
6962

7063
func NewCClient(prot thrift.Protocol) *CClient {
7164
return &CClient{

thrift/compiler/test/fixtures/exceptions/out/go/gen-go/module/svcs.go

-9
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ type RaiserClientInterface interface {
4242
Get500() (string, error)
4343
}
4444

45-
type RaiserContextClientInterface interface {
46-
RaiserClientInterface
47-
DoBlandContext(ctx context.Context) (error)
48-
DoRaiseContext(ctx context.Context) (error)
49-
Get200Context(ctx context.Context) (string, error)
50-
Get500Context(ctx context.Context) (string, error)
51-
}
52-
5345
type RaiserChannelClient struct {
5446
ch thrift.RequestChannel
5547
}
@@ -71,7 +63,6 @@ type RaiserClient struct {
7163
}
7264
// Compile time interface enforcer
7365
var _ RaiserClientInterface = (*RaiserClient)(nil)
74-
var _ RaiserContextClientInterface = (*RaiserClient)(nil)
7566

7667
func NewRaiserClient(prot thrift.Protocol) *RaiserClient {
7768
return &RaiserClient{

thrift/compiler/test/fixtures/go-service/out/go/gen-go/module/svcs.go

-27
Original file line numberDiff line numberDiff line change
@@ -78,32 +78,6 @@ type GetEntityClientInterface interface {
7878
GetErr1Collision(err int64, err1 int64) (int32, error)
7979
}
8080

81-
type GetEntityContextClientInterface interface {
82-
GetEntityClientInterface
83-
GetEntityContext(ctx context.Context, r *GetEntityRequest) (*GetEntityResponse, error)
84-
GetBoolContext(ctx context.Context) (bool, error)
85-
GetByteContext(ctx context.Context) (int8, error)
86-
GetI16Context(ctx context.Context) (int16, error)
87-
GetI32Context(ctx context.Context) (int32, error)
88-
GetI64Context(ctx context.Context) (int64, error)
89-
GetDoubleContext(ctx context.Context) (float64, error)
90-
GetStringContext(ctx context.Context) (string, error)
91-
GetBinaryContext(ctx context.Context) ([]byte, error)
92-
GetMapContext(ctx context.Context) (map[string]string, error)
93-
GetSetContext(ctx context.Context) ([]string, error)
94-
GetListContext(ctx context.Context) ([]string, error)
95-
GetLegacyStuffContext(ctx context.Context, numPos int64, numNeg1 int64, numNeg2 int64) (int32, error)
96-
GetCtxCollisionContext(ctx1 context.Context, ctx int64) (int32, error)
97-
GetCtx1CollisionContext(ctx2 context.Context, ctx int64, ctx1 int64) (int32, error)
98-
GetContextCollisionContext(ctx context.Context, context_ int64) (int32, error)
99-
GetOutCollisionContext(ctx context.Context, out int64) (int32, error)
100-
GetOut1CollisionContext(ctx context.Context, out int64, out1 int64) (int32, error)
101-
GetInCollisionContext(ctx context.Context, in int64) (int32, error)
102-
GetIn1CollisionContext(ctx context.Context, in int64, in1 int64) (int32, error)
103-
GetErrCollisionContext(ctx context.Context, err int64) (int32, error)
104-
GetErr1CollisionContext(ctx context.Context, err int64, err1 int64) (int32, error)
105-
}
106-
10781
type GetEntityChannelClient struct {
10882
ch thrift.RequestChannel
10983
}
@@ -125,7 +99,6 @@ type GetEntityClient struct {
12599
}
126100
// Compile time interface enforcer
127101
var _ GetEntityClientInterface = (*GetEntityClient)(nil)
128-
var _ GetEntityContextClientInterface = (*GetEntityClient)(nil)
129102

130103
func NewGetEntityClient(prot thrift.Protocol) *GetEntityClient {
131104
return &GetEntityClient{

thrift/compiler/test/fixtures/go-typedef/out/go_module1/gen-go/module1/svcs.go

-8
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ type FinderClientInterface interface {
4444
PreviousPlate(plate Plate) (Plate, error)
4545
}
4646

47-
type FinderContextClientInterface interface {
48-
FinderClientInterface
49-
ByPlateContext(ctx context.Context, plate Plate) (*Automobile, error)
50-
AliasByPlateContext(ctx context.Context, plate Plate) (*Car, error)
51-
PreviousPlateContext(ctx context.Context, plate Plate) (Plate, error)
52-
}
53-
5447
type FinderChannelClient struct {
5548
ch thrift.RequestChannel
5649
}
@@ -72,7 +65,6 @@ type FinderClient struct {
7265
}
7366
// Compile time interface enforcer
7467
var _ FinderClientInterface = (*FinderClient)(nil)
75-
var _ FinderContextClientInterface = (*FinderClient)(nil)
7668

7769
func NewFinderClient(prot thrift.Protocol) *FinderClient {
7870
return &FinderClient{

0 commit comments

Comments
 (0)