7 Star 1 Fork 1

罗中天 / douyin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
client.go 2.86 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by Kitex v0.4.4. DO NOT EDIT.
package favoriteservice
import (
"context"
favorite_rpc "gitee.com/derrickball/douyin/app/favorite/kitex_gen/favorite_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 {
CreateFavorite(ctx context.Context, Req *favorite_rpc.RPCFavoriteCreateReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFavoriteCreateResp, err error)
DelFavorite(ctx context.Context, Req *favorite_rpc.RPCFavoriteDelReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFavoriteDelResp, err error)
FavoriteList(ctx context.Context, Req *favorite_rpc.RPCFavoriteListReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFavoriteListResp, err error)
FilterFavorite(ctx context.Context, Req *favorite_rpc.RPCFilterFavoriteReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFilterFavoriteResp, 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 &kFavoriteServiceClient{
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 kFavoriteServiceClient struct {
*kClient
}
func (p *kFavoriteServiceClient) CreateFavorite(ctx context.Context, Req *favorite_rpc.RPCFavoriteCreateReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFavoriteCreateResp, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.CreateFavorite(ctx, Req)
}
func (p *kFavoriteServiceClient) DelFavorite(ctx context.Context, Req *favorite_rpc.RPCFavoriteDelReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFavoriteDelResp, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.DelFavorite(ctx, Req)
}
func (p *kFavoriteServiceClient) FavoriteList(ctx context.Context, Req *favorite_rpc.RPCFavoriteListReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFavoriteListResp, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.FavoriteList(ctx, Req)
}
func (p *kFavoriteServiceClient) FilterFavorite(ctx context.Context, Req *favorite_rpc.RPCFilterFavoriteReq, callOptions ...callopt.Option) (r *favorite_rpc.RPCFilterFavoriteResp, err error) {
ctx = client.NewCtxWithCallOptions(ctx, callOptions)
return p.kClient.FilterFavorite(ctx, Req)
}
1
https://gitee.com/derrickball/douyin.git
git@gitee.com:derrickball/douyin.git
derrickball
douyin
douyin
48d44dfe16fa

搜索帮助

53164aa7 5694891 3bd8fe86 5694891