generated from CyanAsterisk/.github
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
client.go
67 lines (55 loc) · 2.98 KB
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Code generated by Kitex v0.4.4. DO NOT EDIT.
package socialityservice
import (
"context"
sociality "github.com/CyanAsterisk/TikGok/server/shared/kitex_gen/sociality"
client "github.com/cloudwego/kitex/client"
callopt "github.com/cloudwego/kitex/client/callopt"
)
// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework.
type Client interface {
Action(ctx context.Context, req *sociality.DouyinRelationActionRequest, callOptions ...callopt.Option) (r *sociality.DouyinRelationActionResponse, err error)
GetRelationIdList(ctx context.Context, req *sociality.DouyinGetRelationIdListRequest, callOptions ...callopt.Option) (r *sociality.DouyinGetRelationIdListResponse, err error)
GetSocialInfo(ctx context.Context, req *sociality.DouyinGetSocialInfoRequest, callOptions ...callopt.Option) (r *sociality.DouyinGetSocialInfoResponse, err error)
BatchGetSocialInfo(ctx context.Context, req *sociality.DouyinBatchGetSocialInfoRequest, callOptions ...callopt.Option) (r *sociality.DouyinBatchGetSocialInfoResponse, err error)
}
// NewClient creates a client for the service defined in IDL.
func NewClient(destService string, opts ...client.Option) (Client, error) {
var options []client.Option
options = append(options, client.WithDestService(destService))
options = append(options, opts...)
kc, err := client.NewClient(serviceInfo(), options...)
if err != nil {
return nil, err
}
return &kSocialityServiceClient{
kClient: newServiceClient(kc),
}, nil
}
// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs.
func MustNewClient(destService string, opts ...client.Option) Client {
kc, err := NewClient(destService, opts...)
if err != nil {
panic(err)
}
return kc
}
type kSocialityServiceClient struct {
*kClient
}
func (p *kSocialityServiceClient) Action(ctx context.Context, req *sociality.DouyinRelationActionRequest, callOptions ...callopt.Option) (r *sociality.DouyinRelationActionResponse, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.Action(ctx, req)
}
func (p *kSocialityServiceClient) GetRelationIdList(ctx context.Context, req *sociality.DouyinGetRelationIdListRequest, callOptions ...callopt.Option) (r *sociality.DouyinGetRelationIdListResponse, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.GetRelationIdList(ctx, req)
}
func (p *kSocialityServiceClient) GetSocialInfo(ctx context.Context, req *sociality.DouyinGetSocialInfoRequest, callOptions ...callopt.Option) (r *sociality.DouyinGetSocialInfoResponse, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.GetSocialInfo(ctx, req)
}
func (p *kSocialityServiceClient) BatchGetSocialInfo(ctx context.Context, req *sociality.DouyinBatchGetSocialInfoRequest, callOptions ...callopt.Option) (r *sociality.DouyinBatchGetSocialInfoResponse, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.BatchGetSocialInfo(ctx, req)
}