7 Star 1 Fork 1

罗中天/douyin

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
client.go 2.35 KB
Copy Edit Raw Blame History
黎博凯 authored 2023-02-14 12:36 +08:00 . fix: comment_rpc kitex_gen提交
// Code generated by Kitex v0.4.4. DO NOT EDIT.
package commentservice
import (
"context"
comment_rpc "gitee.com/derrickball/douyin/app/comment/kitex_gen/comment_rpc"
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 {
CreateComment(ctx context.Context, Req *comment_rpc.RPCCommentCreateReq, callOptions ...callopt.Option) (r *comment_rpc.RPCActionResp, err error)
DelComment(ctx context.Context, Req *comment_rpc.RPCCommentDelReq, callOptions ...callopt.Option) (r *comment_rpc.RPCActionResp, err error)
CommentList(ctx context.Context, Req *comment_rpc.RPCCommentListReq, callOptions ...callopt.Option) (r *comment_rpc.RPCCommentListResp, 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 &kCommentServiceClient{
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 kCommentServiceClient struct {
*kClient
}
func (p *kCommentServiceClient) CreateComment(ctx context.Context, Req *comment_rpc.RPCCommentCreateReq, callOptions ...callopt.Option) (r *comment_rpc.RPCActionResp, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.CreateComment(ctx, Req)
}
func (p *kCommentServiceClient) DelComment(ctx context.Context, Req *comment_rpc.RPCCommentDelReq, callOptions ...callopt.Option) (r *comment_rpc.RPCActionResp, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.DelComment(ctx, Req)
}
func (p *kCommentServiceClient) CommentList(ctx context.Context, Req *comment_rpc.RPCCommentListReq, callOptions ...callopt.Option) (r *comment_rpc.RPCCommentListResp, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.CommentList(ctx, Req)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/derrickball/douyin.git
git@gitee.com:derrickball/douyin.git
derrickball
douyin
douyin
48d44dfe16fa

Search