shopping_role_service.pb.micro.go 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // Code generated by protoc-gen-micro. DO NOT EDIT.
  2. // source: proto/shopping_role_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 ShoppingRoleService service
  25. func NewShoppingRoleServiceEndpoints() []*api.Endpoint {
  26. return []*api.Endpoint{}
  27. }
  28. // Client API for ShoppingRoleService service
  29. type ShoppingRoleService interface {
  30. GetRoleList(ctx context.Context, in *GetRoleListRequest, opts ...client.CallOption) (*GetRoleListResponse, error)
  31. GetRole(ctx context.Context, in *GetRoleRequest, opts ...client.CallOption) (*GetRoleResponse, error)
  32. GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...client.CallOption) (*GetAllRolesResponse, error)
  33. CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...client.CallOption) (*CreateRoleResponse, error)
  34. UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...client.CallOption) (*UpdateRoleResponse, error)
  35. DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...client.CallOption) (*DeleteRoleResponse, error)
  36. ToggleRole(ctx context.Context, in *ToggleRoleRequest, opts ...client.CallOption) (*ToggleRoleResponse, error)
  37. }
  38. type shoppingRoleService struct {
  39. c client.Client
  40. name string
  41. }
  42. func NewShoppingRoleService(name string, c client.Client) ShoppingRoleService {
  43. return &shoppingRoleService{
  44. c: c,
  45. name: name,
  46. }
  47. }
  48. func (c *shoppingRoleService) GetRoleList(ctx context.Context, in *GetRoleListRequest, opts ...client.CallOption) (*GetRoleListResponse, error) {
  49. req := c.c.NewRequest(c.name, "ShoppingRoleService.GetRoleList", in)
  50. out := new(GetRoleListResponse)
  51. err := c.c.Call(ctx, req, out, opts...)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return out, nil
  56. }
  57. func (c *shoppingRoleService) GetRole(ctx context.Context, in *GetRoleRequest, opts ...client.CallOption) (*GetRoleResponse, error) {
  58. req := c.c.NewRequest(c.name, "ShoppingRoleService.GetRole", in)
  59. out := new(GetRoleResponse)
  60. err := c.c.Call(ctx, req, out, opts...)
  61. if err != nil {
  62. return nil, err
  63. }
  64. return out, nil
  65. }
  66. func (c *shoppingRoleService) GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...client.CallOption) (*GetAllRolesResponse, error) {
  67. req := c.c.NewRequest(c.name, "ShoppingRoleService.GetAllRoles", in)
  68. out := new(GetAllRolesResponse)
  69. err := c.c.Call(ctx, req, out, opts...)
  70. if err != nil {
  71. return nil, err
  72. }
  73. return out, nil
  74. }
  75. func (c *shoppingRoleService) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...client.CallOption) (*CreateRoleResponse, error) {
  76. req := c.c.NewRequest(c.name, "ShoppingRoleService.CreateRole", in)
  77. out := new(CreateRoleResponse)
  78. err := c.c.Call(ctx, req, out, opts...)
  79. if err != nil {
  80. return nil, err
  81. }
  82. return out, nil
  83. }
  84. func (c *shoppingRoleService) UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...client.CallOption) (*UpdateRoleResponse, error) {
  85. req := c.c.NewRequest(c.name, "ShoppingRoleService.UpdateRole", in)
  86. out := new(UpdateRoleResponse)
  87. err := c.c.Call(ctx, req, out, opts...)
  88. if err != nil {
  89. return nil, err
  90. }
  91. return out, nil
  92. }
  93. func (c *shoppingRoleService) DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...client.CallOption) (*DeleteRoleResponse, error) {
  94. req := c.c.NewRequest(c.name, "ShoppingRoleService.DeleteRole", in)
  95. out := new(DeleteRoleResponse)
  96. err := c.c.Call(ctx, req, out, opts...)
  97. if err != nil {
  98. return nil, err
  99. }
  100. return out, nil
  101. }
  102. func (c *shoppingRoleService) ToggleRole(ctx context.Context, in *ToggleRoleRequest, opts ...client.CallOption) (*ToggleRoleResponse, error) {
  103. req := c.c.NewRequest(c.name, "ShoppingRoleService.ToggleRole", in)
  104. out := new(ToggleRoleResponse)
  105. err := c.c.Call(ctx, req, out, opts...)
  106. if err != nil {
  107. return nil, err
  108. }
  109. return out, nil
  110. }
  111. // Server API for ShoppingRoleService service
  112. type ShoppingRoleServiceHandler interface {
  113. GetRoleList(context.Context, *GetRoleListRequest, *GetRoleListResponse) error
  114. GetRole(context.Context, *GetRoleRequest, *GetRoleResponse) error
  115. GetAllRoles(context.Context, *GetAllRolesRequest, *GetAllRolesResponse) error
  116. CreateRole(context.Context, *CreateRoleRequest, *CreateRoleResponse) error
  117. UpdateRole(context.Context, *UpdateRoleRequest, *UpdateRoleResponse) error
  118. DeleteRole(context.Context, *DeleteRoleRequest, *DeleteRoleResponse) error
  119. ToggleRole(context.Context, *ToggleRoleRequest, *ToggleRoleResponse) error
  120. }
  121. func RegisterShoppingRoleServiceHandler(s server.Server, hdlr ShoppingRoleServiceHandler, opts ...server.HandlerOption) error {
  122. type shoppingRoleService interface {
  123. GetRoleList(ctx context.Context, in *GetRoleListRequest, out *GetRoleListResponse) error
  124. GetRole(ctx context.Context, in *GetRoleRequest, out *GetRoleResponse) error
  125. GetAllRoles(ctx context.Context, in *GetAllRolesRequest, out *GetAllRolesResponse) error
  126. CreateRole(ctx context.Context, in *CreateRoleRequest, out *CreateRoleResponse) error
  127. UpdateRole(ctx context.Context, in *UpdateRoleRequest, out *UpdateRoleResponse) error
  128. DeleteRole(ctx context.Context, in *DeleteRoleRequest, out *DeleteRoleResponse) error
  129. ToggleRole(ctx context.Context, in *ToggleRoleRequest, out *ToggleRoleResponse) error
  130. }
  131. type ShoppingRoleService struct {
  132. shoppingRoleService
  133. }
  134. h := &shoppingRoleServiceHandler{hdlr}
  135. return s.Handle(s.NewHandler(&ShoppingRoleService{h}, opts...))
  136. }
  137. type shoppingRoleServiceHandler struct {
  138. ShoppingRoleServiceHandler
  139. }
  140. func (h *shoppingRoleServiceHandler) GetRoleList(ctx context.Context, in *GetRoleListRequest, out *GetRoleListResponse) error {
  141. return h.ShoppingRoleServiceHandler.GetRoleList(ctx, in, out)
  142. }
  143. func (h *shoppingRoleServiceHandler) GetRole(ctx context.Context, in *GetRoleRequest, out *GetRoleResponse) error {
  144. return h.ShoppingRoleServiceHandler.GetRole(ctx, in, out)
  145. }
  146. func (h *shoppingRoleServiceHandler) GetAllRoles(ctx context.Context, in *GetAllRolesRequest, out *GetAllRolesResponse) error {
  147. return h.ShoppingRoleServiceHandler.GetAllRoles(ctx, in, out)
  148. }
  149. func (h *shoppingRoleServiceHandler) CreateRole(ctx context.Context, in *CreateRoleRequest, out *CreateRoleResponse) error {
  150. return h.ShoppingRoleServiceHandler.CreateRole(ctx, in, out)
  151. }
  152. func (h *shoppingRoleServiceHandler) UpdateRole(ctx context.Context, in *UpdateRoleRequest, out *UpdateRoleResponse) error {
  153. return h.ShoppingRoleServiceHandler.UpdateRole(ctx, in, out)
  154. }
  155. func (h *shoppingRoleServiceHandler) DeleteRole(ctx context.Context, in *DeleteRoleRequest, out *DeleteRoleResponse) error {
  156. return h.ShoppingRoleServiceHandler.DeleteRole(ctx, in, out)
  157. }
  158. func (h *shoppingRoleServiceHandler) ToggleRole(ctx context.Context, in *ToggleRoleRequest, out *ToggleRoleResponse) error {
  159. return h.ShoppingRoleServiceHandler.ToggleRole(ctx, in, out)
  160. }