App.liverpc.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/App.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/App.proto
  8. v1/BaseInfo.proto
  9. v1/Feed.proto
  10. */
  11. package v1
  12. import context "context"
  13. import proto "github.com/golang/protobuf/proto"
  14. import "go-common/library/net/rpc/liverpc"
  15. var _ proto.Message // generate to suppress unused imports
  16. // Imports only used by utility functions:
  17. // =============
  18. // App Interface
  19. // =============
  20. type App interface {
  21. // * 关注接口
  22. // 【粉版APP5.31 关注排序改版】App首页我的关注部分【全量数据】
  23. LiveHomePage(context.Context, *AppLiveHomePageReq) (*AppLiveHomePageResp, error)
  24. }
  25. // ===================
  26. // App Live Rpc Client
  27. // ===================
  28. type appRpcClient struct {
  29. client *liverpc.Client
  30. }
  31. // NewAppRpcClient creates a Rpc client that implements the App interface.
  32. // It communicates using Rpc and can be configured with a custom HTTPClient.
  33. func NewAppRpcClient(client *liverpc.Client) App {
  34. return &appRpcClient{
  35. client: client,
  36. }
  37. }
  38. func (c *appRpcClient) LiveHomePage(ctx context.Context, in *AppLiveHomePageReq) (*AppLiveHomePageResp, error) {
  39. out := new(AppLiveHomePageResp)
  40. err := doRpcRequest(ctx, c.client, 1, "App.LiveHomePage", in, out)
  41. if err != nil {
  42. return nil, err
  43. }
  44. return out, nil
  45. }
  46. // =====
  47. // Utils
  48. // =====
  49. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  50. err = client.Call(ctx, version, method, in, out)
  51. return
  52. }