App.liverpc.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v2/App.proto
  3. /*
  4. Package v2 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. v2/App.proto
  8. */
  9. package v2
  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. // App Interface
  17. // =============
  18. type App interface {
  19. // * 关注接口
  20. // 【粉版APP5.33 关注排序改版】App首页我的关注部分【全量数据】
  21. LiveHomePage(context.Context, *AppLiveHomePageReq) (*AppLiveHomePageResp, error)
  22. }
  23. // ===================
  24. // App Live Rpc Client
  25. // ===================
  26. type appRpcClient struct {
  27. client *liverpc.Client
  28. }
  29. // NewAppRpcClient creates a Rpc client that implements the App interface.
  30. // It communicates using Rpc and can be configured with a custom HTTPClient.
  31. func NewAppRpcClient(client *liverpc.Client) App {
  32. return &appRpcClient{
  33. client: client,
  34. }
  35. }
  36. func (c *appRpcClient) LiveHomePage(ctx context.Context, in *AppLiveHomePageReq) (*AppLiveHomePageResp, error) {
  37. out := new(AppLiveHomePageResp)
  38. err := doRpcRequest(ctx, c.client, 2, "App.LiveHomePage", in, out)
  39. if err != nil {
  40. return nil, err
  41. }
  42. return out, nil
  43. }
  44. // =====
  45. // Utils
  46. // =====
  47. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  48. err = client.Call(ctx, version, method, in, out)
  49. return
  50. }