common_service.pb.micro.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Code generated by protoc-gen-micro. DO NOT EDIT.
  2. // source: proto/common_service.proto
  3. package authorization_service
  4. import (
  5. fmt "fmt"
  6. proto "google.golang.org/protobuf/proto"
  7. math "math"
  8. )
  9. import (
  10. context "context"
  11. api "go-micro.dev/v4/api"
  12. client "go-micro.dev/v4/client"
  13. server "go-micro.dev/v4/server"
  14. )
  15. // Reference imports to suppress errors if they are not otherwise used.
  16. var _ = proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // Reference imports to suppress errors if they are not otherwise used.
  20. var _ api.Endpoint
  21. var _ context.Context
  22. var _ client.Option
  23. var _ server.Option
  24. // Api Endpoints for CommonService service
  25. func NewCommonServiceEndpoints() []*api.Endpoint {
  26. return []*api.Endpoint{}
  27. }
  28. // Client API for CommonService service
  29. type CommonService interface {
  30. AdminLogin(ctx context.Context, in *AdminLoginRequest, opts ...client.CallOption) (*AdminLoginResponse, error)
  31. AdminLogout(ctx context.Context, in *AdminLogoutRequest, opts ...client.CallOption) (*AdminLogoutResponse, error)
  32. AdminProfile(ctx context.Context, in *AdminProfileRequest, opts ...client.CallOption) (*AdminProfileResponse, error)
  33. }
  34. type commonService struct {
  35. c client.Client
  36. name string
  37. }
  38. func NewCommonService(name string, c client.Client) CommonService {
  39. return &commonService{
  40. c: c,
  41. name: name,
  42. }
  43. }
  44. func (c *commonService) AdminLogin(ctx context.Context, in *AdminLoginRequest, opts ...client.CallOption) (*AdminLoginResponse, error) {
  45. req := c.c.NewRequest(c.name, "CommonService.AdminLogin", in)
  46. out := new(AdminLoginResponse)
  47. err := c.c.Call(ctx, req, out, opts...)
  48. if err != nil {
  49. return nil, err
  50. }
  51. return out, nil
  52. }
  53. func (c *commonService) AdminLogout(ctx context.Context, in *AdminLogoutRequest, opts ...client.CallOption) (*AdminLogoutResponse, error) {
  54. req := c.c.NewRequest(c.name, "CommonService.AdminLogout", in)
  55. out := new(AdminLogoutResponse)
  56. err := c.c.Call(ctx, req, out, opts...)
  57. if err != nil {
  58. return nil, err
  59. }
  60. return out, nil
  61. }
  62. func (c *commonService) AdminProfile(ctx context.Context, in *AdminProfileRequest, opts ...client.CallOption) (*AdminProfileResponse, error) {
  63. req := c.c.NewRequest(c.name, "CommonService.AdminProfile", in)
  64. out := new(AdminProfileResponse)
  65. err := c.c.Call(ctx, req, out, opts...)
  66. if err != nil {
  67. return nil, err
  68. }
  69. return out, nil
  70. }
  71. // Server API for CommonService service
  72. type CommonServiceHandler interface {
  73. AdminLogin(context.Context, *AdminLoginRequest, *AdminLoginResponse) error
  74. AdminLogout(context.Context, *AdminLogoutRequest, *AdminLogoutResponse) error
  75. AdminProfile(context.Context, *AdminProfileRequest, *AdminProfileResponse) error
  76. }
  77. func RegisterCommonServiceHandler(s server.Server, hdlr CommonServiceHandler, opts ...server.HandlerOption) error {
  78. type commonService interface {
  79. AdminLogin(ctx context.Context, in *AdminLoginRequest, out *AdminLoginResponse) error
  80. AdminLogout(ctx context.Context, in *AdminLogoutRequest, out *AdminLogoutResponse) error
  81. AdminProfile(ctx context.Context, in *AdminProfileRequest, out *AdminProfileResponse) error
  82. }
  83. type CommonService struct {
  84. commonService
  85. }
  86. h := &commonServiceHandler{hdlr}
  87. return s.Handle(s.NewHandler(&CommonService{h}, opts...))
  88. }
  89. type commonServiceHandler struct {
  90. CommonServiceHandler
  91. }
  92. func (h *commonServiceHandler) AdminLogin(ctx context.Context, in *AdminLoginRequest, out *AdminLoginResponse) error {
  93. return h.CommonServiceHandler.AdminLogin(ctx, in, out)
  94. }
  95. func (h *commonServiceHandler) AdminLogout(ctx context.Context, in *AdminLogoutRequest, out *AdminLogoutResponse) error {
  96. return h.CommonServiceHandler.AdminLogout(ctx, in, out)
  97. }
  98. func (h *commonServiceHandler) AdminProfile(ctx context.Context, in *AdminProfileRequest, out *AdminProfileResponse) error {
  99. return h.CommonServiceHandler.AdminProfile(ctx, in, out)
  100. }