User.liverpc.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v3/User.proto
  3. /*
  4. Package v3 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. v3/User.proto
  8. */
  9. package v3
  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. // User Interface
  17. // ==============
  18. type User interface {
  19. // * uid获取房间信息
  20. //
  21. GetMultiple(context.Context, *UserGetMultipleReq) (*UserGetMultipleResp, error)
  22. // * uid获取房间信息
  23. //
  24. GetUserLevelInfo(context.Context, *UserGetUserLevelInfoReq) (*UserGetUserLevelInfoResp, error)
  25. }
  26. // ====================
  27. // User Live Rpc Client
  28. // ====================
  29. type userRpcClient struct {
  30. client *liverpc.Client
  31. }
  32. // NewUserRpcClient creates a Rpc client that implements the User interface.
  33. // It communicates using Rpc and can be configured with a custom HTTPClient.
  34. func NewUserRpcClient(client *liverpc.Client) User {
  35. return &userRpcClient{
  36. client: client,
  37. }
  38. }
  39. func (c *userRpcClient) GetMultiple(ctx context.Context, in *UserGetMultipleReq) (*UserGetMultipleResp, error) {
  40. out := new(UserGetMultipleResp)
  41. err := doRpcRequest(ctx, c.client, 3, "User.getMultiple", in, out)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return out, nil
  46. }
  47. func (c *userRpcClient) GetUserLevelInfo(ctx context.Context, in *UserGetUserLevelInfoReq) (*UserGetUserLevelInfoResp, error) {
  48. out := new(UserGetUserLevelInfoResp)
  49. err := doRpcRequest(ctx, c.client, 3, "User.getUserLevelInfo", in, out)
  50. if err != nil {
  51. return nil, err
  52. }
  53. return out, nil
  54. }
  55. // =====
  56. // Utils
  57. // =====
  58. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  59. err = client.Call(ctx, version, method, in, out)
  60. return
  61. }