Documentation ¶
Index ¶
- Variables
- func RegisterCartServiceServer(s grpc.ServiceRegistrar, srv CartServiceServer)
- type CartItem
- func (*CartItem) Descriptor() ([]byte, []int)deprecated
- func (x *CartItem) GetId() string
- func (x *CartItem) GetProductSku() string
- func (x *CartItem) GetQuantity() int32
- func (x *CartItem) GetUserId() string
- func (*CartItem) ProtoMessage()
- func (x *CartItem) ProtoReflect() protoreflect.Message
- func (x *CartItem) Reset()
- func (x *CartItem) String() string
- type CartServiceClient
- type CartServiceServer
- type GetUserCartInput
- type GetUserCartResponse
- func (*GetUserCartResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserCartResponse) GetItems() []*CartItem
- func (*GetUserCartResponse) ProtoMessage()
- func (x *GetUserCartResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserCartResponse) Reset()
- func (x *GetUserCartResponse) String() string
- type NewCartItem
- func (*NewCartItem) Descriptor() ([]byte, []int)deprecated
- func (x *NewCartItem) GetProductSku() string
- func (x *NewCartItem) GetQuantity() int32
- func (x *NewCartItem) GetUserId() string
- func (*NewCartItem) ProtoMessage()
- func (x *NewCartItem) ProtoReflect() protoreflect.Message
- func (x *NewCartItem) Reset()
- func (x *NewCartItem) String() string
- type RemoveItemsFromCartInput
- func (*RemoveItemsFromCartInput) Descriptor() ([]byte, []int)deprecated
- func (x *RemoveItemsFromCartInput) GetItemIds() []string
- func (x *RemoveItemsFromCartInput) GetUserId() string
- func (*RemoveItemsFromCartInput) ProtoMessage()
- func (x *RemoveItemsFromCartInput) ProtoReflect() protoreflect.Message
- func (x *RemoveItemsFromCartInput) Reset()
- func (x *RemoveItemsFromCartInput) String() string
- type RemoveItemsFromCartResponse
- func (*RemoveItemsFromCartResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RemoveItemsFromCartResponse) GetItems() []*CartItem
- func (*RemoveItemsFromCartResponse) ProtoMessage()
- func (x *RemoveItemsFromCartResponse) ProtoReflect() protoreflect.Message
- func (x *RemoveItemsFromCartResponse) Reset()
- func (x *RemoveItemsFromCartResponse) String() string
- type UnimplementedCartServiceServer
- func (UnimplementedCartServiceServer) AddToCart(context.Context, *NewCartItem) (*CartItem, error)
- func (UnimplementedCartServiceServer) GetUserCart(context.Context, *GetUserCartInput) (*GetUserCartResponse, error)
- func (UnimplementedCartServiceServer) RemoveItemsFromCart(context.Context, *RemoveItemsFromCartInput) (*RemoveItemsFromCartResponse, error)
- type UnsafeCartServiceServer
Constants ¶
This section is empty.
Variables ¶
var CartService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "CartService", HandlerType: (*CartServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AddToCart", Handler: _CartService_AddToCart_Handler, }, { MethodName: "GetUserCart", Handler: _CartService_GetUserCart_Handler, }, { MethodName: "RemoveItemsFromCart", Handler: _CartService_RemoveItemsFromCart_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cart.proto", }
CartService_ServiceDesc is the grpc.ServiceDesc for CartService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_cart_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCartServiceServer ¶
func RegisterCartServiceServer(s grpc.ServiceRegistrar, srv CartServiceServer)
Types ¶
type CartItem ¶
type CartItem struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ProductSku string `protobuf:"bytes,2,opt,name=productSku,proto3" json:"productSku,omitempty"` UserId string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"` Quantity int32 `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*CartItem) Descriptor
deprecated
func (*CartItem) GetProductSku ¶
func (*CartItem) GetQuantity ¶
func (*CartItem) ProtoMessage ¶
func (*CartItem) ProtoMessage()
func (*CartItem) ProtoReflect ¶
func (x *CartItem) ProtoReflect() protoreflect.Message
type CartServiceClient ¶
type CartServiceClient interface { AddToCart(ctx context.Context, in *NewCartItem, opts ...grpc.CallOption) (*CartItem, error) GetUserCart(ctx context.Context, in *GetUserCartInput, opts ...grpc.CallOption) (*GetUserCartResponse, error) RemoveItemsFromCart(ctx context.Context, in *RemoveItemsFromCartInput, opts ...grpc.CallOption) (*RemoveItemsFromCartResponse, error) }
CartServiceClient is the client API for CartService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewCartServiceClient ¶
func NewCartServiceClient(cc grpc.ClientConnInterface) CartServiceClient
type CartServiceServer ¶
type CartServiceServer interface { AddToCart(context.Context, *NewCartItem) (*CartItem, error) GetUserCart(context.Context, *GetUserCartInput) (*GetUserCartResponse, error) RemoveItemsFromCart(context.Context, *RemoveItemsFromCartInput) (*RemoveItemsFromCartResponse, error) // contains filtered or unexported methods }
CartServiceServer is the server API for CartService service. All implementations must embed UnimplementedCartServiceServer for forward compatibility
type GetUserCartInput ¶
type GetUserCartInput struct { UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*GetUserCartInput) Descriptor
deprecated
func (*GetUserCartInput) Descriptor() ([]byte, []int)
Deprecated: Use GetUserCartInput.ProtoReflect.Descriptor instead.
func (*GetUserCartInput) GetUserId ¶
func (x *GetUserCartInput) GetUserId() string
func (*GetUserCartInput) ProtoMessage ¶
func (*GetUserCartInput) ProtoMessage()
func (*GetUserCartInput) ProtoReflect ¶
func (x *GetUserCartInput) ProtoReflect() protoreflect.Message
func (*GetUserCartInput) Reset ¶
func (x *GetUserCartInput) Reset()
func (*GetUserCartInput) String ¶
func (x *GetUserCartInput) String() string
type GetUserCartResponse ¶
type GetUserCartResponse struct { Items []*CartItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*GetUserCartResponse) Descriptor
deprecated
func (*GetUserCartResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserCartResponse.ProtoReflect.Descriptor instead.
func (*GetUserCartResponse) GetItems ¶
func (x *GetUserCartResponse) GetItems() []*CartItem
func (*GetUserCartResponse) ProtoMessage ¶
func (*GetUserCartResponse) ProtoMessage()
func (*GetUserCartResponse) ProtoReflect ¶
func (x *GetUserCartResponse) ProtoReflect() protoreflect.Message
func (*GetUserCartResponse) Reset ¶
func (x *GetUserCartResponse) Reset()
func (*GetUserCartResponse) String ¶
func (x *GetUserCartResponse) String() string
type NewCartItem ¶
type NewCartItem struct { ProductSku string `protobuf:"bytes,1,opt,name=productSku,proto3" json:"productSku,omitempty"` UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*NewCartItem) Descriptor
deprecated
func (*NewCartItem) Descriptor() ([]byte, []int)
Deprecated: Use NewCartItem.ProtoReflect.Descriptor instead.
func (*NewCartItem) GetProductSku ¶
func (x *NewCartItem) GetProductSku() string
func (*NewCartItem) GetQuantity ¶
func (x *NewCartItem) GetQuantity() int32
func (*NewCartItem) GetUserId ¶
func (x *NewCartItem) GetUserId() string
func (*NewCartItem) ProtoMessage ¶
func (*NewCartItem) ProtoMessage()
func (*NewCartItem) ProtoReflect ¶
func (x *NewCartItem) ProtoReflect() protoreflect.Message
func (*NewCartItem) Reset ¶
func (x *NewCartItem) Reset()
func (*NewCartItem) String ¶
func (x *NewCartItem) String() string
type RemoveItemsFromCartInput ¶
type RemoveItemsFromCartInput struct { UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` ItemIds []string `protobuf:"bytes,2,rep,name=itemIds,proto3" json:"itemIds,omitempty"` // contains filtered or unexported fields }
func (*RemoveItemsFromCartInput) Descriptor
deprecated
func (*RemoveItemsFromCartInput) Descriptor() ([]byte, []int)
Deprecated: Use RemoveItemsFromCartInput.ProtoReflect.Descriptor instead.
func (*RemoveItemsFromCartInput) GetItemIds ¶
func (x *RemoveItemsFromCartInput) GetItemIds() []string
func (*RemoveItemsFromCartInput) GetUserId ¶
func (x *RemoveItemsFromCartInput) GetUserId() string
func (*RemoveItemsFromCartInput) ProtoMessage ¶
func (*RemoveItemsFromCartInput) ProtoMessage()
func (*RemoveItemsFromCartInput) ProtoReflect ¶
func (x *RemoveItemsFromCartInput) ProtoReflect() protoreflect.Message
func (*RemoveItemsFromCartInput) Reset ¶
func (x *RemoveItemsFromCartInput) Reset()
func (*RemoveItemsFromCartInput) String ¶
func (x *RemoveItemsFromCartInput) String() string
type RemoveItemsFromCartResponse ¶
type RemoveItemsFromCartResponse struct { Items []*CartItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*RemoveItemsFromCartResponse) Descriptor
deprecated
func (*RemoveItemsFromCartResponse) Descriptor() ([]byte, []int)
Deprecated: Use RemoveItemsFromCartResponse.ProtoReflect.Descriptor instead.
func (*RemoveItemsFromCartResponse) GetItems ¶
func (x *RemoveItemsFromCartResponse) GetItems() []*CartItem
func (*RemoveItemsFromCartResponse) ProtoMessage ¶
func (*RemoveItemsFromCartResponse) ProtoMessage()
func (*RemoveItemsFromCartResponse) ProtoReflect ¶
func (x *RemoveItemsFromCartResponse) ProtoReflect() protoreflect.Message
func (*RemoveItemsFromCartResponse) Reset ¶
func (x *RemoveItemsFromCartResponse) Reset()
func (*RemoveItemsFromCartResponse) String ¶
func (x *RemoveItemsFromCartResponse) String() string
type UnimplementedCartServiceServer ¶
type UnimplementedCartServiceServer struct { }
UnimplementedCartServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedCartServiceServer) AddToCart ¶
func (UnimplementedCartServiceServer) AddToCart(context.Context, *NewCartItem) (*CartItem, error)
func (UnimplementedCartServiceServer) GetUserCart ¶
func (UnimplementedCartServiceServer) GetUserCart(context.Context, *GetUserCartInput) (*GetUserCartResponse, error)
func (UnimplementedCartServiceServer) RemoveItemsFromCart ¶
func (UnimplementedCartServiceServer) RemoveItemsFromCart(context.Context, *RemoveItemsFromCartInput) (*RemoveItemsFromCartResponse, error)
type UnsafeCartServiceServer ¶
type UnsafeCartServiceServer interface {
// contains filtered or unexported methods
}
UnsafeCartServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CartServiceServer will result in compilation errors.