Broadcast.liverpc.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v0/Broadcast.proto
  3. /*
  4. Package v0 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. v0/Broadcast.proto
  8. */
  9. package v0
  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. // Broadcast Interface
  17. // ===================
  18. type BroadcastRPCClient interface {
  19. // * 发送 NOTICE_MSG 广播接口
  20. // 如果有定义默认样式的, 且如果样式字段没有传, 会被补全; 最终输出字段格式参考 http://info.bilibili.co/pages/viewpage.action?pageId=3693681#id-%E5%BC%B9%E5%B9%95%E9%80%9A%E7%9F%A5%E5%8D%8F%E8%AE%AE-%E6%96%B0%E7%89%88%E5%BC%B9%E5%B9%95%E9%80%9A%E7%9F%A5%E5%8D%8F%E8%AE%AE
  21. SendNoticeMsg(ctx context.Context, req *BroadcastSendNoticeMsgReq, opts ...liverpc.CallOption) (resp *BroadcastSendNoticeMsgResp, err error)
  22. }
  23. // =========================
  24. // Broadcast Live Rpc Client
  25. // =========================
  26. type broadcastRPCClient struct {
  27. client *liverpc.Client
  28. }
  29. // NewBroadcastRPCClient creates a client that implements the BroadcastRPCClient interface.
  30. func NewBroadcastRPCClient(client *liverpc.Client) BroadcastRPCClient {
  31. return &broadcastRPCClient{
  32. client: client,
  33. }
  34. }
  35. func (c *broadcastRPCClient) SendNoticeMsg(ctx context.Context, in *BroadcastSendNoticeMsgReq, opts ...liverpc.CallOption) (*BroadcastSendNoticeMsgResp, error) {
  36. out := new(BroadcastSendNoticeMsgResp)
  37. err := doRPCRequest(ctx, c.client, 0, "Broadcast.send_notice_msg", in, out, opts)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. // =====
  44. // Utils
  45. // =====
  46. func doRPCRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message, opts []liverpc.CallOption) (err error) {
  47. err = client.Call(ctx, version, method, in, out, opts...)
  48. return
  49. }