PayLive.liverpc.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v0/PayLive.proto
  3. package v0
  4. import context "context"
  5. import proto "github.com/golang/protobuf/proto"
  6. import "go-common/library/net/rpc/liverpc"
  7. var _ proto.Message // generate to suppress unused imports
  8. // =================
  9. // PayLive Interface
  10. // =================
  11. type PayLive interface {
  12. // * 生成付费直播信息
  13. //
  14. Add(context.Context, *PayLiveAddReq) (*PayLiveAddResp, error)
  15. // * 更新付费直播信息
  16. //
  17. Update(context.Context, *PayLiveUpdateReq) (*PayLiveUpdateResp, error)
  18. // * 获取付费直播列表
  19. //
  20. GetList(context.Context, *PayLiveGetListReq) (*PayLiveGetListResp, error)
  21. // * 关闭鉴权
  22. //
  23. Close(context.Context, *PayLiveCloseReq) (*PayLiveCloseResp, error)
  24. // * 开启鉴权
  25. //
  26. Open(context.Context, *PayLiveOpenReq) (*PayLiveOpenResp, error)
  27. }
  28. // =======================
  29. // PayLive Live Rpc Client
  30. // =======================
  31. type payLiveRpcClient struct {
  32. client *liverpc.Client
  33. }
  34. // NewPayLiveRpcClient creates a Rpc client that implements the PayLive interface.
  35. // It communicates using Rpc and can be configured with a custom HTTPClient.
  36. func NewPayLiveRpcClient(client *liverpc.Client) PayLive {
  37. return &payLiveRpcClient{
  38. client: client,
  39. }
  40. }
  41. func (c *payLiveRpcClient) Add(ctx context.Context, in *PayLiveAddReq) (*PayLiveAddResp, error) {
  42. out := new(PayLiveAddResp)
  43. err := doRpcRequest(ctx, c.client, 0, "PayLive.add", in, out)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return out, nil
  48. }
  49. func (c *payLiveRpcClient) Update(ctx context.Context, in *PayLiveUpdateReq) (*PayLiveUpdateResp, error) {
  50. out := new(PayLiveUpdateResp)
  51. err := doRpcRequest(ctx, c.client, 0, "PayLive.update", in, out)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return out, nil
  56. }
  57. func (c *payLiveRpcClient) GetList(ctx context.Context, in *PayLiveGetListReq) (*PayLiveGetListResp, error) {
  58. out := new(PayLiveGetListResp)
  59. err := doRpcRequest(ctx, c.client, 0, "PayLive.getList", in, out)
  60. if err != nil {
  61. return nil, err
  62. }
  63. return out, nil
  64. }
  65. func (c *payLiveRpcClient) Close(ctx context.Context, in *PayLiveCloseReq) (*PayLiveCloseResp, error) {
  66. out := new(PayLiveCloseResp)
  67. err := doRpcRequest(ctx, c.client, 0, "PayLive.close", in, out)
  68. if err != nil {
  69. return nil, err
  70. }
  71. return out, nil
  72. }
  73. func (c *payLiveRpcClient) Open(ctx context.Context, in *PayLiveOpenReq) (*PayLiveOpenResp, error) {
  74. out := new(PayLiveOpenResp)
  75. err := doRpcRequest(ctx, c.client, 0, "PayLive.open", in, out)
  76. if err != nil {
  77. return nil, err
  78. }
  79. return out, nil
  80. }