Documentation ¶
Index ¶
- func InternalCartItemToProto(item *cart.CartItem) *proto.CartItem
- func ProtoNewCartItemToInternal(item *proto.NewCartItem) *cart.CartItem
- type CartServer
- func (s *CartServer) AddToCart(ctx context.Context, req *proto.NewCartItem) (*proto.CartItem, error)
- func (s *CartServer) GetUserCart(ctx context.Context, input *proto.GetUserCartInput) (*proto.GetUserCartResponse, error)
- func (s *CartServer) RemoveItemsFromCart(ctx context.Context, input *proto.RemoveItemsFromCartInput) (*proto.RemoveItemsFromCartResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProtoNewCartItemToInternal ¶
func ProtoNewCartItemToInternal(item *proto.NewCartItem) *cart.CartItem
Types ¶
type CartServer ¶
type CartServer struct { proto.UnimplementedCartServiceServer // contains filtered or unexported fields }
func NewCartServer ¶
func NewCartServer(cartService services.CartService) *CartServer
NewCartServer returns a new cart grpc service server object.
func (*CartServer) AddToCart ¶
func (s *CartServer) AddToCart(ctx context.Context, req *proto.NewCartItem) (*proto.CartItem, error)
AddToCart is the grpc handler to add item to cart.
func (*CartServer) GetUserCart ¶
func (s *CartServer) GetUserCart(ctx context.Context, input *proto.GetUserCartInput) (*proto.GetUserCartResponse, error)
GetUserCart is the grpc handler to get user cart.
func (*CartServer) RemoveItemsFromCart ¶
func (s *CartServer) RemoveItemsFromCart( ctx context.Context, input *proto.RemoveItemsFromCartInput, ) (*proto.RemoveItemsFromCartResponse, error)
RemoveItemsFromCart is the grpc handler to remove items from user cart.
Click to show internal directories.
Click to hide internal directories.