shopping_user_service.pb.micro.go 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. // Code generated by protoc-gen-micro. DO NOT EDIT.
  2. // source: proto/shopping_user_service.proto
  3. package shopping_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 ShoppingUserService service
  25. func NewShoppingUserServiceEndpoints() []*api.Endpoint {
  26. return []*api.Endpoint{}
  27. }
  28. // Client API for ShoppingUserService service
  29. type ShoppingUserService interface {
  30. GetUserList(ctx context.Context, in *GetUserListRequest, opts ...client.CallOption) (*GetUserListResponse, error)
  31. GetUser(ctx context.Context, in *GetUserRequest, opts ...client.CallOption) (*GetUserResponse, error)
  32. CreateUser(ctx context.Context, in *CreateUserRequest, opts ...client.CallOption) (*CreateUserResponse, error)
  33. UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...client.CallOption) (*UpdateUserResponse, error)
  34. DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...client.CallOption) (*DeleteUserResponse, error)
  35. ToggleUser(ctx context.Context, in *ToggleUserRequest, opts ...client.CallOption) (*ToggleUserResponse, error)
  36. }
  37. type shoppingUserService struct {
  38. c client.Client
  39. name string
  40. }
  41. func NewShoppingUserService(name string, c client.Client) ShoppingUserService {
  42. return &shoppingUserService{
  43. c: c,
  44. name: name,
  45. }
  46. }
  47. func (c *shoppingUserService) GetUserList(ctx context.Context, in *GetUserListRequest, opts ...client.CallOption) (*GetUserListResponse, error) {
  48. req := c.c.NewRequest(c.name, "ShoppingUserService.GetUserList", in)
  49. out := new(GetUserListResponse)
  50. err := c.c.Call(ctx, req, out, opts...)
  51. if err != nil {
  52. return nil, err
  53. }
  54. return out, nil
  55. }
  56. func (c *shoppingUserService) GetUser(ctx context.Context, in *GetUserRequest, opts ...client.CallOption) (*GetUserResponse, error) {
  57. req := c.c.NewRequest(c.name, "ShoppingUserService.GetUser", in)
  58. out := new(GetUserResponse)
  59. err := c.c.Call(ctx, req, out, opts...)
  60. if err != nil {
  61. return nil, err
  62. }
  63. return out, nil
  64. }
  65. func (c *shoppingUserService) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...client.CallOption) (*CreateUserResponse, error) {
  66. req := c.c.NewRequest(c.name, "ShoppingUserService.CreateUser", in)
  67. out := new(CreateUserResponse)
  68. err := c.c.Call(ctx, req, out, opts...)
  69. if err != nil {
  70. return nil, err
  71. }
  72. return out, nil
  73. }
  74. func (c *shoppingUserService) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...client.CallOption) (*UpdateUserResponse, error) {
  75. req := c.c.NewRequest(c.name, "ShoppingUserService.UpdateUser", in)
  76. out := new(UpdateUserResponse)
  77. err := c.c.Call(ctx, req, out, opts...)
  78. if err != nil {
  79. return nil, err
  80. }
  81. return out, nil
  82. }
  83. func (c *shoppingUserService) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...client.CallOption) (*DeleteUserResponse, error) {
  84. req := c.c.NewRequest(c.name, "ShoppingUserService.DeleteUser", in)
  85. out := new(DeleteUserResponse)
  86. err := c.c.Call(ctx, req, out, opts...)
  87. if err != nil {
  88. return nil, err
  89. }
  90. return out, nil
  91. }
  92. func (c *shoppingUserService) ToggleUser(ctx context.Context, in *ToggleUserRequest, opts ...client.CallOption) (*ToggleUserResponse, error) {
  93. req := c.c.NewRequest(c.name, "ShoppingUserService.ToggleUser", in)
  94. out := new(ToggleUserResponse)
  95. err := c.c.Call(ctx, req, out, opts...)
  96. if err != nil {
  97. return nil, err
  98. }
  99. return out, nil
  100. }
  101. // Server API for ShoppingUserService service
  102. type ShoppingUserServiceHandler interface {
  103. GetUserList(context.Context, *GetUserListRequest, *GetUserListResponse) error
  104. GetUser(context.Context, *GetUserRequest, *GetUserResponse) error
  105. CreateUser(context.Context, *CreateUserRequest, *CreateUserResponse) error
  106. UpdateUser(context.Context, *UpdateUserRequest, *UpdateUserResponse) error
  107. DeleteUser(context.Context, *DeleteUserRequest, *DeleteUserResponse) error
  108. ToggleUser(context.Context, *ToggleUserRequest, *ToggleUserResponse) error
  109. }
  110. func RegisterShoppingUserServiceHandler(s server.Server, hdlr ShoppingUserServiceHandler, opts ...server.HandlerOption) error {
  111. type shoppingUserService interface {
  112. GetUserList(ctx context.Context, in *GetUserListRequest, out *GetUserListResponse) error
  113. GetUser(ctx context.Context, in *GetUserRequest, out *GetUserResponse) error
  114. CreateUser(ctx context.Context, in *CreateUserRequest, out *CreateUserResponse) error
  115. UpdateUser(ctx context.Context, in *UpdateUserRequest, out *UpdateUserResponse) error
  116. DeleteUser(ctx context.Context, in *DeleteUserRequest, out *DeleteUserResponse) error
  117. ToggleUser(ctx context.Context, in *ToggleUserRequest, out *ToggleUserResponse) error
  118. }
  119. type ShoppingUserService struct {
  120. shoppingUserService
  121. }
  122. h := &shoppingUserServiceHandler{hdlr}
  123. return s.Handle(s.NewHandler(&ShoppingUserService{h}, opts...))
  124. }
  125. type shoppingUserServiceHandler struct {
  126. ShoppingUserServiceHandler
  127. }
  128. func (h *shoppingUserServiceHandler) GetUserList(ctx context.Context, in *GetUserListRequest, out *GetUserListResponse) error {
  129. return h.ShoppingUserServiceHandler.GetUserList(ctx, in, out)
  130. }
  131. func (h *shoppingUserServiceHandler) GetUser(ctx context.Context, in *GetUserRequest, out *GetUserResponse) error {
  132. return h.ShoppingUserServiceHandler.GetUser(ctx, in, out)
  133. }
  134. func (h *shoppingUserServiceHandler) CreateUser(ctx context.Context, in *CreateUserRequest, out *CreateUserResponse) error {
  135. return h.ShoppingUserServiceHandler.CreateUser(ctx, in, out)
  136. }
  137. func (h *shoppingUserServiceHandler) UpdateUser(ctx context.Context, in *UpdateUserRequest, out *UpdateUserResponse) error {
  138. return h.ShoppingUserServiceHandler.UpdateUser(ctx, in, out)
  139. }
  140. func (h *shoppingUserServiceHandler) DeleteUser(ctx context.Context, in *DeleteUserRequest, out *DeleteUserResponse) error {
  141. return h.ShoppingUserServiceHandler.DeleteUser(ctx, in, out)
  142. }
  143. func (h *shoppingUserServiceHandler) ToggleUser(ctx context.Context, in *ToggleUserRequest, out *ToggleUserResponse) error {
  144. return h.ShoppingUserServiceHandler.ToggleUser(ctx, in, out)
  145. }