PayGoods.liverpc.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v0/PayGoods.proto
  3. /*
  4. Package v0 is a generated liverpc stub package.
  5. This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
  6. It is generated from these files:
  7. v0/PayGoods.proto
  8. v0/PayLive.proto
  9. */
  10. package v0
  11. import context "context"
  12. import proto "github.com/golang/protobuf/proto"
  13. import "go-common/library/net/rpc/liverpc"
  14. var _ proto.Message // generate to suppress unused imports
  15. // Imports only used by utility functions:
  16. // ==================
  17. // PayGoods Interface
  18. // ==================
  19. type PayGoods interface {
  20. // * 生成一张付费直播票
  21. //
  22. Add(context.Context, *PayGoodsAddReq) (*PayGoodsAddResp, error)
  23. // * 更新一张付费直播票
  24. //
  25. Update(context.Context, *PayGoodsUpdateReq) (*PayGoodsUpdateResp, error)
  26. // * 获取付费直播票列表
  27. //
  28. GetList(context.Context, *PayGoodsGetListReq) (*PayGoodsGetListResp, error)
  29. // * 关闭购票
  30. //
  31. Close(context.Context, *PayGoodsCloseReq) (*PayGoodsCloseResp, error)
  32. // * 开启购票
  33. //
  34. Open(context.Context, *PayGoodsOpenReq) (*PayGoodsOpenResp, error)
  35. }
  36. // ========================
  37. // PayGoods Live Rpc Client
  38. // ========================
  39. type payGoodsRpcClient struct {
  40. client *liverpc.Client
  41. }
  42. // NewPayGoodsRpcClient creates a Rpc client that implements the PayGoods interface.
  43. // It communicates using Rpc and can be configured with a custom HTTPClient.
  44. func NewPayGoodsRpcClient(client *liverpc.Client) PayGoods {
  45. return &payGoodsRpcClient{
  46. client: client,
  47. }
  48. }
  49. func (c *payGoodsRpcClient) Add(ctx context.Context, in *PayGoodsAddReq) (*PayGoodsAddResp, error) {
  50. out := new(PayGoodsAddResp)
  51. err := doRpcRequest(ctx, c.client, 0, "PayGoods.add", in, out)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return out, nil
  56. }
  57. func (c *payGoodsRpcClient) Update(ctx context.Context, in *PayGoodsUpdateReq) (*PayGoodsUpdateResp, error) {
  58. out := new(PayGoodsUpdateResp)
  59. err := doRpcRequest(ctx, c.client, 0, "PayGoods.update", in, out)
  60. if err != nil {
  61. return nil, err
  62. }
  63. return out, nil
  64. }
  65. func (c *payGoodsRpcClient) GetList(ctx context.Context, in *PayGoodsGetListReq) (*PayGoodsGetListResp, error) {
  66. out := new(PayGoodsGetListResp)
  67. err := doRpcRequest(ctx, c.client, 0, "PayGoods.getList", in, out)
  68. if err != nil {
  69. return nil, err
  70. }
  71. return out, nil
  72. }
  73. func (c *payGoodsRpcClient) Close(ctx context.Context, in *PayGoodsCloseReq) (*PayGoodsCloseResp, error) {
  74. out := new(PayGoodsCloseResp)
  75. err := doRpcRequest(ctx, c.client, 0, "PayGoods.close", in, out)
  76. if err != nil {
  77. return nil, err
  78. }
  79. return out, nil
  80. }
  81. func (c *payGoodsRpcClient) Open(ctx context.Context, in *PayGoodsOpenReq) (*PayGoodsOpenResp, error) {
  82. out := new(PayGoodsOpenResp)
  83. err := doRpcRequest(ctx, c.client, 0, "PayGoods.open", in, out)
  84. if err != nil {
  85. return nil, err
  86. }
  87. return out, nil
  88. }
  89. // =====
  90. // Utils
  91. // =====
  92. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  93. err = client.Call(ctx, version, method, in, out)
  94. return
  95. }