Room.liverpc.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/Room.proto
  3. /*
  4. Package v1 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. v1/Room.proto
  8. */
  9. package v1
  10. import context "context"
  11. import proto "github.com/golang/protobuf/proto"
  12. import "go-common/library/net/rpc/liverpc"
  13. var _ proto.Message // generate to suppress unused imports
  14. // Imports only used by utility functions:
  15. // ==============
  16. // Room Interface
  17. // ==============
  18. type RoomRPCClient interface {
  19. // * 根据房间id获取房间信息
  20. GetInfoById(ctx context.Context, req *RoomGetInfoByIdReq, opts ...liverpc.CallOption) (resp *RoomGetInfoByIdResp, err error)
  21. // * 获取房间基本信息接口,前端/移动端房间页使用
  22. GetInfo(ctx context.Context, req *RoomGetInfoReq, opts ...liverpc.CallOption) (resp *RoomGetInfoResp, err error)
  23. }
  24. // ====================
  25. // Room Live Rpc Client
  26. // ====================
  27. type roomRPCClient struct {
  28. client *liverpc.Client
  29. }
  30. // NewRoomRPCClient creates a client that implements the RoomRPCClient interface.
  31. func NewRoomRPCClient(client *liverpc.Client) RoomRPCClient {
  32. return &roomRPCClient{
  33. client: client,
  34. }
  35. }
  36. func (c *roomRPCClient) GetInfoById(ctx context.Context, in *RoomGetInfoByIdReq, opts ...liverpc.CallOption) (*RoomGetInfoByIdResp, error) {
  37. out := new(RoomGetInfoByIdResp)
  38. err := doRPCRequest(ctx, c.client, 1, "Room.get_info_by_id", in, out, opts)
  39. if err != nil {
  40. return nil, err
  41. }
  42. return out, nil
  43. }
  44. func (c *roomRPCClient) GetInfo(ctx context.Context, in *RoomGetInfoReq, opts ...liverpc.CallOption) (*RoomGetInfoResp, error) {
  45. out := new(RoomGetInfoResp)
  46. err := doRPCRequest(ctx, c.client, 1, "Room.get_info", in, out, opts)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return out, nil
  51. }
  52. // =====
  53. // Utils
  54. // =====
  55. func doRPCRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message, opts []liverpc.CallOption) (err error) {
  56. err = client.Call(ctx, version, method, in, out, opts...)
  57. return
  58. }