AdminSilent.liverpc.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/AdminSilent.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/AdminSilent.proto
  8. v1/Shield.proto
  9. v1/ShieldMng.proto
  10. v1/Silent.proto
  11. v1/SilentMng.proto
  12. v1/SiteBlockMng.proto
  13. */
  14. package v1
  15. import context "context"
  16. import proto "github.com/golang/protobuf/proto"
  17. import "go-common/library/net/rpc/liverpc"
  18. var _ proto.Message // generate to suppress unused imports
  19. // Imports only used by utility functions:
  20. // =====================
  21. // AdminSilent Interface
  22. // =====================
  23. type AdminSilent interface {
  24. // * 查询运营规则
  25. // 拿着规则直接用就好了,有就肯定是当前生效的配置
  26. GetShieldRule(context.Context, *AdminSilentGetShieldRuleReq) (*AdminSilentGetShieldRuleResp, error)
  27. }
  28. // ===========================
  29. // AdminSilent Live Rpc Client
  30. // ===========================
  31. type adminSilentRpcClient struct {
  32. client *liverpc.Client
  33. }
  34. // NewAdminSilentRpcClient creates a Rpc client that implements the AdminSilent interface.
  35. // It communicates using Rpc and can be configured with a custom HTTPClient.
  36. func NewAdminSilentRpcClient(client *liverpc.Client) AdminSilent {
  37. return &adminSilentRpcClient{
  38. client: client,
  39. }
  40. }
  41. func (c *adminSilentRpcClient) GetShieldRule(ctx context.Context, in *AdminSilentGetShieldRuleReq) (*AdminSilentGetShieldRuleResp, error) {
  42. out := new(AdminSilentGetShieldRuleResp)
  43. err := doRpcRequest(ctx, c.client, 1, "AdminSilent.get_shield_rule", in, out)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return out, nil
  48. }
  49. // =====
  50. // Utils
  51. // =====
  52. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  53. err = client.Call(ctx, version, method, in, out)
  54. return
  55. }