shopping_shoppingcart_service.pb.micro.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // Code generated by protoc-gen-micro. DO NOT EDIT.
  2. // source: proto/shopping_shoppingcart_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 CartItemService service
  25. func NewCartItemServiceEndpoints() []*api.Endpoint {
  26. return []*api.Endpoint{}
  27. }
  28. // Client API for CartItemService service
  29. type CartItemService interface {
  30. CreateShoppingCart(ctx context.Context, in *CreateShoppingCartRequest, opts ...client.CallOption) (*CreateShoppingCartResponse, error)
  31. CreateShoppingCartItem(ctx context.Context, in *CreateShoppingCartItemRequest, opts ...client.CallOption) (*CreateShoppingCartItemResponse, error)
  32. }
  33. type cartItemService struct {
  34. c client.Client
  35. name string
  36. }
  37. func NewCartItemService(name string, c client.Client) CartItemService {
  38. return &cartItemService{
  39. c: c,
  40. name: name,
  41. }
  42. }
  43. func (c *cartItemService) CreateShoppingCart(ctx context.Context, in *CreateShoppingCartRequest, opts ...client.CallOption) (*CreateShoppingCartResponse, error) {
  44. req := c.c.NewRequest(c.name, "CartItemService.CreateShoppingCart", in)
  45. out := new(CreateShoppingCartResponse)
  46. err := c.c.Call(ctx, req, out, opts...)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return out, nil
  51. }
  52. func (c *cartItemService) CreateShoppingCartItem(ctx context.Context, in *CreateShoppingCartItemRequest, opts ...client.CallOption) (*CreateShoppingCartItemResponse, error) {
  53. req := c.c.NewRequest(c.name, "CartItemService.CreateShoppingCartItem", in)
  54. out := new(CreateShoppingCartItemResponse)
  55. err := c.c.Call(ctx, req, out, opts...)
  56. if err != nil {
  57. return nil, err
  58. }
  59. return out, nil
  60. }
  61. // Server API for CartItemService service
  62. type CartItemServiceHandler interface {
  63. CreateShoppingCart(context.Context, *CreateShoppingCartRequest, *CreateShoppingCartResponse) error
  64. CreateShoppingCartItem(context.Context, *CreateShoppingCartItemRequest, *CreateShoppingCartItemResponse) error
  65. }
  66. func RegisterCartItemServiceHandler(s server.Server, hdlr CartItemServiceHandler, opts ...server.HandlerOption) error {
  67. type cartItemService interface {
  68. CreateShoppingCart(ctx context.Context, in *CreateShoppingCartRequest, out *CreateShoppingCartResponse) error
  69. CreateShoppingCartItem(ctx context.Context, in *CreateShoppingCartItemRequest, out *CreateShoppingCartItemResponse) error
  70. }
  71. type CartItemService struct {
  72. cartItemService
  73. }
  74. h := &cartItemServiceHandler{hdlr}
  75. return s.Handle(s.NewHandler(&CartItemService{h}, opts...))
  76. }
  77. type cartItemServiceHandler struct {
  78. CartItemServiceHandler
  79. }
  80. func (h *cartItemServiceHandler) CreateShoppingCart(ctx context.Context, in *CreateShoppingCartRequest, out *CreateShoppingCartResponse) error {
  81. return h.CartItemServiceHandler.CreateShoppingCart(ctx, in, out)
  82. }
  83. func (h *cartItemServiceHandler) CreateShoppingCartItem(ctx context.Context, in *CreateShoppingCartItemRequest, out *CreateShoppingCartItemResponse) error {
  84. return h.CartItemServiceHandler.CreateShoppingCartItem(ctx, in, out)
  85. }