123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
- // source: v0/PayGoods.proto
- /*
- Package v0 is a generated liverpc stub package.
- This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
- It is generated from these files:
- v0/PayGoods.proto
- v0/PayLive.proto
- */
- package v0
- import context "context"
- import proto "github.com/golang/protobuf/proto"
- import "go-common/library/net/rpc/liverpc"
- var _ proto.Message // generate to suppress unused imports
- // Imports only used by utility functions:
- // ==================
- // PayGoods Interface
- // ==================
- type PayGoods interface {
- // * 生成一张付费直播票
- //
- Add(context.Context, *PayGoodsAddReq) (*PayGoodsAddResp, error)
- // * 更新一张付费直播票
- //
- Update(context.Context, *PayGoodsUpdateReq) (*PayGoodsUpdateResp, error)
- // * 获取付费直播票列表
- //
- GetList(context.Context, *PayGoodsGetListReq) (*PayGoodsGetListResp, error)
- // * 关闭购票
- //
- Close(context.Context, *PayGoodsCloseReq) (*PayGoodsCloseResp, error)
- // * 开启购票
- //
- Open(context.Context, *PayGoodsOpenReq) (*PayGoodsOpenResp, error)
- }
- // ========================
- // PayGoods Live Rpc Client
- // ========================
- type payGoodsRpcClient struct {
- client *liverpc.Client
- }
- // NewPayGoodsRpcClient creates a Rpc client that implements the PayGoods interface.
- // It communicates using Rpc and can be configured with a custom HTTPClient.
- func NewPayGoodsRpcClient(client *liverpc.Client) PayGoods {
- return &payGoodsRpcClient{
- client: client,
- }
- }
- func (c *payGoodsRpcClient) Add(ctx context.Context, in *PayGoodsAddReq) (*PayGoodsAddResp, error) {
- out := new(PayGoodsAddResp)
- err := doRpcRequest(ctx, c.client, 0, "PayGoods.add", in, out)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *payGoodsRpcClient) Update(ctx context.Context, in *PayGoodsUpdateReq) (*PayGoodsUpdateResp, error) {
- out := new(PayGoodsUpdateResp)
- err := doRpcRequest(ctx, c.client, 0, "PayGoods.update", in, out)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *payGoodsRpcClient) GetList(ctx context.Context, in *PayGoodsGetListReq) (*PayGoodsGetListResp, error) {
- out := new(PayGoodsGetListResp)
- err := doRpcRequest(ctx, c.client, 0, "PayGoods.getList", in, out)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *payGoodsRpcClient) Close(ctx context.Context, in *PayGoodsCloseReq) (*PayGoodsCloseResp, error) {
- out := new(PayGoodsCloseResp)
- err := doRpcRequest(ctx, c.client, 0, "PayGoods.close", in, out)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *payGoodsRpcClient) Open(ctx context.Context, in *PayGoodsOpenReq) (*PayGoodsOpenResp, error) {
- out := new(PayGoodsOpenResp)
- err := doRpcRequest(ctx, c.client, 0, "PayGoods.open", in, out)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- // =====
- // Utils
- // =====
- func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
- err = client.Call(ctx, version, method, in, out)
- return
- }
|