Rank2018.liverpc.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/Rank2018.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/Rank2018.proto
  8. v1/UserRank.proto
  9. */
  10. package v1
  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. // Rank2018 Interface
  18. // ==================
  19. type Rank2018 interface {
  20. // * 获取上小时榜topN
  21. //
  22. GetHourRank(context.Context, *Rank2018GetHourRankReq) (*Rank2018GetHourRankResp, error)
  23. }
  24. // ========================
  25. // Rank2018 Live Rpc Client
  26. // ========================
  27. type rank2018RpcClient struct {
  28. client *liverpc.Client
  29. }
  30. // NewRank2018RpcClient creates a Rpc client that implements the Rank2018 interface.
  31. // It communicates using Rpc and can be configured with a custom HTTPClient.
  32. func NewRank2018RpcClient(client *liverpc.Client) Rank2018 {
  33. return &rank2018RpcClient{
  34. client: client,
  35. }
  36. }
  37. func (c *rank2018RpcClient) GetHourRank(ctx context.Context, in *Rank2018GetHourRankReq) (*Rank2018GetHourRankResp, error) {
  38. out := new(Rank2018GetHourRankResp)
  39. err := doRpcRequest(ctx, c.client, 1, "Rank2018.getHourRank", in, out)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return out, nil
  44. }
  45. // =====
  46. // Utils
  47. // =====
  48. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  49. err = client.Call(ctx, version, method, in, out)
  50. return
  51. }