Anchor.liverpc.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v2/Anchor.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/Anchor.proto
  8. v2/HighQps.proto
  9. */
  10. package v2
  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. // Anchor Interface
  18. // ================
  19. type Anchor interface {
  20. // * 查看房管的勋章信息
  21. //
  22. QueryLiveWearing(context.Context, *AnchorQueryLiveWearingReq) (*AnchorQueryLiveWearingResp, error)
  23. }
  24. // ======================
  25. // Anchor Live Rpc Client
  26. // ======================
  27. type anchorRpcClient struct {
  28. client *liverpc.Client
  29. }
  30. // NewAnchorRpcClient creates a Rpc client that implements the Anchor interface.
  31. // It communicates using Rpc and can be configured with a custom HTTPClient.
  32. func NewAnchorRpcClient(client *liverpc.Client) Anchor {
  33. return &anchorRpcClient{
  34. client: client,
  35. }
  36. }
  37. func (c *anchorRpcClient) QueryLiveWearing(ctx context.Context, in *AnchorQueryLiveWearingReq) (*AnchorQueryLiveWearingResp, error) {
  38. out := new(AnchorQueryLiveWearingResp)
  39. err := doRpcRequest(ctx, c.client, 2, "Anchor.query_live_wearing", 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. }