Documentation ¶
Overview ¶
Package basketspb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterBasketServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterBasketServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BasketServiceClient) error
- func RegisterBasketServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterBasketServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BasketServiceServer) error
- func RegisterBasketServiceServer(s grpc.ServiceRegistrar, srv BasketServiceServer)
- func Registrations(reg registry.Registry) error
- type AddItemRequest
- func (*AddItemRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddItemRequest) GetId() string
- func (x *AddItemRequest) GetProductId() string
- func (x *AddItemRequest) GetQuantity() int32
- func (*AddItemRequest) ProtoMessage()
- func (x *AddItemRequest) ProtoReflect() protoreflect.Message
- func (x *AddItemRequest) Reset()
- func (x *AddItemRequest) String() string
- type AddItemResponse
- type Basket
- type BasketCanceled
- func (*BasketCanceled) Descriptor() ([]byte, []int)deprecated
- func (x *BasketCanceled) GetId() string
- func (*BasketCanceled) Key() string
- func (*BasketCanceled) ProtoMessage()
- func (x *BasketCanceled) ProtoReflect() protoreflect.Message
- func (x *BasketCanceled) Reset()
- func (x *BasketCanceled) String() string
- type BasketCheckedOut
- func (*BasketCheckedOut) Descriptor() ([]byte, []int)deprecated
- func (x *BasketCheckedOut) GetCustomerId() string
- func (x *BasketCheckedOut) GetId() string
- func (x *BasketCheckedOut) GetItems() []*BasketCheckedOut_Item
- func (x *BasketCheckedOut) GetPaymentId() string
- func (*BasketCheckedOut) Key() string
- func (*BasketCheckedOut) ProtoMessage()
- func (x *BasketCheckedOut) ProtoReflect() protoreflect.Message
- func (x *BasketCheckedOut) Reset()
- func (x *BasketCheckedOut) String() string
- type BasketCheckedOut_Item
- func (*BasketCheckedOut_Item) Descriptor() ([]byte, []int)deprecated
- func (x *BasketCheckedOut_Item) GetPrice() float64
- func (x *BasketCheckedOut_Item) GetProductId() string
- func (x *BasketCheckedOut_Item) GetProductName() string
- func (x *BasketCheckedOut_Item) GetQuantity() int32
- func (x *BasketCheckedOut_Item) GetStoreId() string
- func (x *BasketCheckedOut_Item) GetStoreName() string
- func (*BasketCheckedOut_Item) ProtoMessage()
- func (x *BasketCheckedOut_Item) ProtoReflect() protoreflect.Message
- func (x *BasketCheckedOut_Item) Reset()
- func (x *BasketCheckedOut_Item) String() string
- type BasketServiceClient
- type BasketServiceServer
- type BasketStarted
- func (*BasketStarted) Descriptor() ([]byte, []int)deprecated
- func (x *BasketStarted) GetCustomerId() string
- func (x *BasketStarted) GetId() string
- func (*BasketStarted) Key() string
- func (*BasketStarted) ProtoMessage()
- func (x *BasketStarted) ProtoReflect() protoreflect.Message
- func (x *BasketStarted) Reset()
- func (x *BasketStarted) String() string
- type CancelBasketRequest
- func (*CancelBasketRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CancelBasketRequest) GetId() string
- func (*CancelBasketRequest) ProtoMessage()
- func (x *CancelBasketRequest) ProtoReflect() protoreflect.Message
- func (x *CancelBasketRequest) Reset()
- func (x *CancelBasketRequest) String() string
- type CancelBasketResponse
- type CheckoutBasketRequest
- func (*CheckoutBasketRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CheckoutBasketRequest) GetId() string
- func (x *CheckoutBasketRequest) GetPaymentId() string
- func (*CheckoutBasketRequest) ProtoMessage()
- func (x *CheckoutBasketRequest) ProtoReflect() protoreflect.Message
- func (x *CheckoutBasketRequest) Reset()
- func (x *CheckoutBasketRequest) String() string
- type CheckoutBasketResponse
- type GetBasketRequest
- type GetBasketResponse
- type Item
- func (*Item) Descriptor() ([]byte, []int)deprecated
- func (x *Item) GetProductId() string
- func (x *Item) GetProductName() string
- func (x *Item) GetProductPrice() float64
- func (x *Item) GetQuantity() int32
- func (x *Item) GetStoreId() string
- func (x *Item) GetStoreName() string
- func (*Item) ProtoMessage()
- func (x *Item) ProtoReflect() protoreflect.Message
- func (x *Item) Reset()
- func (x *Item) String() string
- type MockBasketServiceClient
- func (_m *MockBasketServiceClient) AddItem(ctx context.Context, in *AddItemRequest, opts ...grpc.CallOption) (*AddItemResponse, error)
- func (_m *MockBasketServiceClient) CancelBasket(ctx context.Context, in *CancelBasketRequest, opts ...grpc.CallOption) (*CancelBasketResponse, error)
- func (_m *MockBasketServiceClient) CheckoutBasket(ctx context.Context, in *CheckoutBasketRequest, opts ...grpc.CallOption) (*CheckoutBasketResponse, error)
- func (_m *MockBasketServiceClient) GetBasket(ctx context.Context, in *GetBasketRequest, opts ...grpc.CallOption) (*GetBasketResponse, error)
- func (_m *MockBasketServiceClient) RemoveItem(ctx context.Context, in *RemoveItemRequest, opts ...grpc.CallOption) (*RemoveItemResponse, error)
- func (_m *MockBasketServiceClient) StartBasket(ctx context.Context, in *StartBasketRequest, opts ...grpc.CallOption) (*StartBasketResponse, error)
- type MockBasketServiceServer
- func (_m *MockBasketServiceServer) AddItem(_a0 context.Context, _a1 *AddItemRequest) (*AddItemResponse, error)
- func (_m *MockBasketServiceServer) CancelBasket(_a0 context.Context, _a1 *CancelBasketRequest) (*CancelBasketResponse, error)
- func (_m *MockBasketServiceServer) CheckoutBasket(_a0 context.Context, _a1 *CheckoutBasketRequest) (*CheckoutBasketResponse, error)
- func (_m *MockBasketServiceServer) GetBasket(_a0 context.Context, _a1 *GetBasketRequest) (*GetBasketResponse, error)
- func (_m *MockBasketServiceServer) RemoveItem(_a0 context.Context, _a1 *RemoveItemRequest) (*RemoveItemResponse, error)
- func (_m *MockBasketServiceServer) StartBasket(_a0 context.Context, _a1 *StartBasketRequest) (*StartBasketResponse, error)
- type MockUnsafeBasketServiceServer
- type RemoveItemRequest
- func (*RemoveItemRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RemoveItemRequest) GetId() string
- func (x *RemoveItemRequest) GetProductId() string
- func (x *RemoveItemRequest) GetQuantity() int32
- func (*RemoveItemRequest) ProtoMessage()
- func (x *RemoveItemRequest) ProtoReflect() protoreflect.Message
- func (x *RemoveItemRequest) Reset()
- func (x *RemoveItemRequest) String() string
- type RemoveItemResponse
- type StartBasketRequest
- func (*StartBasketRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StartBasketRequest) GetCustomerId() string
- func (*StartBasketRequest) ProtoMessage()
- func (x *StartBasketRequest) ProtoReflect() protoreflect.Message
- func (x *StartBasketRequest) Reset()
- func (x *StartBasketRequest) String() string
- type StartBasketResponse
- func (*StartBasketResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StartBasketResponse) GetId() string
- func (*StartBasketResponse) ProtoMessage()
- func (x *StartBasketResponse) ProtoReflect() protoreflect.Message
- func (x *StartBasketResponse) Reset()
- func (x *StartBasketResponse) String() string
- type UnimplementedBasketServiceServer
- func (UnimplementedBasketServiceServer) AddItem(context.Context, *AddItemRequest) (*AddItemResponse, error)
- func (UnimplementedBasketServiceServer) CancelBasket(context.Context, *CancelBasketRequest) (*CancelBasketResponse, error)
- func (UnimplementedBasketServiceServer) CheckoutBasket(context.Context, *CheckoutBasketRequest) (*CheckoutBasketResponse, error)
- func (UnimplementedBasketServiceServer) GetBasket(context.Context, *GetBasketRequest) (*GetBasketResponse, error)
- func (UnimplementedBasketServiceServer) RemoveItem(context.Context, *RemoveItemRequest) (*RemoveItemResponse, error)
- func (UnimplementedBasketServiceServer) StartBasket(context.Context, *StartBasketRequest) (*StartBasketResponse, error)
- type UnsafeBasketServiceServer
Constants ¶
const ( BasketAggregateChannel = "mallbots.baskets.events.Basket" BasketStartedEvent = "basketsapi.BasketStarted" BasketCanceledEvent = "basketsapi.BasketCanceled" BasketCheckedOutEvent = "basketsapi.BasketCheckedOut" )
Variables ¶
var BasketService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "basketspb.BasketService", HandlerType: (*BasketServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "StartBasket", Handler: _BasketService_StartBasket_Handler, }, { MethodName: "CancelBasket", Handler: _BasketService_CancelBasket_Handler, }, { MethodName: "CheckoutBasket", Handler: _BasketService_CheckoutBasket_Handler, }, { MethodName: "AddItem", Handler: _BasketService_AddItem_Handler, }, { MethodName: "RemoveItem", Handler: _BasketService_RemoveItem_Handler, }, { MethodName: "GetBasket", Handler: _BasketService_GetBasket_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "basketspb/api.proto", }
BasketService_ServiceDesc is the grpc.ServiceDesc for BasketService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_basketspb_api_proto protoreflect.FileDescriptor
var File_basketspb_events_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBasketServiceHandler ¶
func RegisterBasketServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterBasketServiceHandler registers the http handlers for service BasketService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterBasketServiceHandlerClient ¶
func RegisterBasketServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BasketServiceClient) error
RegisterBasketServiceHandlerClient registers the http handlers for service BasketService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BasketServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BasketServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BasketServiceClient" to call the correct interceptors.
func RegisterBasketServiceHandlerFromEndpoint ¶
func RegisterBasketServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterBasketServiceHandlerFromEndpoint is same as RegisterBasketServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBasketServiceHandlerServer ¶
func RegisterBasketServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BasketServiceServer) error
RegisterBasketServiceHandlerServer registers the http handlers for service BasketService to "mux". UnaryRPC :call BasketServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBasketServiceHandlerFromEndpoint instead.
func RegisterBasketServiceServer ¶
func RegisterBasketServiceServer(s grpc.ServiceRegistrar, srv BasketServiceServer)
func Registrations ¶
Types ¶
type AddItemRequest ¶
type AddItemRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ProductId string `protobuf:"bytes,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` Quantity int32 `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*AddItemRequest) Descriptor
deprecated
func (*AddItemRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddItemRequest.ProtoReflect.Descriptor instead.
func (*AddItemRequest) GetId ¶
func (x *AddItemRequest) GetId() string
func (*AddItemRequest) GetProductId ¶
func (x *AddItemRequest) GetProductId() string
func (*AddItemRequest) GetQuantity ¶
func (x *AddItemRequest) GetQuantity() int32
func (*AddItemRequest) ProtoMessage ¶
func (*AddItemRequest) ProtoMessage()
func (*AddItemRequest) ProtoReflect ¶
func (x *AddItemRequest) ProtoReflect() protoreflect.Message
func (*AddItemRequest) Reset ¶
func (x *AddItemRequest) Reset()
func (*AddItemRequest) String ¶
func (x *AddItemRequest) String() string
type AddItemResponse ¶
type AddItemResponse struct {
// contains filtered or unexported fields
}
func (*AddItemResponse) Descriptor
deprecated
func (*AddItemResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddItemResponse.ProtoReflect.Descriptor instead.
func (*AddItemResponse) ProtoMessage ¶
func (*AddItemResponse) ProtoMessage()
func (*AddItemResponse) ProtoReflect ¶
func (x *AddItemResponse) ProtoReflect() protoreflect.Message
func (*AddItemResponse) Reset ¶
func (x *AddItemResponse) Reset()
func (*AddItemResponse) String ¶
func (x *AddItemResponse) String() string
type Basket ¶
type Basket struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*Basket) Descriptor
deprecated
func (*Basket) ProtoMessage ¶
func (*Basket) ProtoMessage()
func (*Basket) ProtoReflect ¶
func (x *Basket) ProtoReflect() protoreflect.Message
type BasketCanceled ¶
type BasketCanceled struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*BasketCanceled) Descriptor
deprecated
func (*BasketCanceled) Descriptor() ([]byte, []int)
Deprecated: Use BasketCanceled.ProtoReflect.Descriptor instead.
func (*BasketCanceled) GetId ¶
func (x *BasketCanceled) GetId() string
func (*BasketCanceled) Key ¶
func (*BasketCanceled) Key() string
func (*BasketCanceled) ProtoMessage ¶
func (*BasketCanceled) ProtoMessage()
func (*BasketCanceled) ProtoReflect ¶
func (x *BasketCanceled) ProtoReflect() protoreflect.Message
func (*BasketCanceled) Reset ¶
func (x *BasketCanceled) Reset()
func (*BasketCanceled) String ¶
func (x *BasketCanceled) String() string
type BasketCheckedOut ¶
type BasketCheckedOut struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` PaymentId string `protobuf:"bytes,3,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"` Items []*BasketCheckedOut_Item `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*BasketCheckedOut) Descriptor
deprecated
func (*BasketCheckedOut) Descriptor() ([]byte, []int)
Deprecated: Use BasketCheckedOut.ProtoReflect.Descriptor instead.
func (*BasketCheckedOut) GetCustomerId ¶
func (x *BasketCheckedOut) GetCustomerId() string
func (*BasketCheckedOut) GetId ¶
func (x *BasketCheckedOut) GetId() string
func (*BasketCheckedOut) GetItems ¶
func (x *BasketCheckedOut) GetItems() []*BasketCheckedOut_Item
func (*BasketCheckedOut) GetPaymentId ¶
func (x *BasketCheckedOut) GetPaymentId() string
func (*BasketCheckedOut) Key ¶
func (*BasketCheckedOut) Key() string
func (*BasketCheckedOut) ProtoMessage ¶
func (*BasketCheckedOut) ProtoMessage()
func (*BasketCheckedOut) ProtoReflect ¶
func (x *BasketCheckedOut) ProtoReflect() protoreflect.Message
func (*BasketCheckedOut) Reset ¶
func (x *BasketCheckedOut) Reset()
func (*BasketCheckedOut) String ¶
func (x *BasketCheckedOut) String() string
type BasketCheckedOut_Item ¶
type BasketCheckedOut_Item struct { StoreId string `protobuf:"bytes,1,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` StoreName string `protobuf:"bytes,3,opt,name=store_name,json=storeName,proto3" json:"store_name,omitempty"` ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` Price float64 `protobuf:"fixed64,5,opt,name=price,proto3" json:"price,omitempty"` Quantity int32 `protobuf:"varint,6,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*BasketCheckedOut_Item) Descriptor
deprecated
func (*BasketCheckedOut_Item) Descriptor() ([]byte, []int)
Deprecated: Use BasketCheckedOut_Item.ProtoReflect.Descriptor instead.
func (*BasketCheckedOut_Item) GetPrice ¶
func (x *BasketCheckedOut_Item) GetPrice() float64
func (*BasketCheckedOut_Item) GetProductId ¶
func (x *BasketCheckedOut_Item) GetProductId() string
func (*BasketCheckedOut_Item) GetProductName ¶
func (x *BasketCheckedOut_Item) GetProductName() string
func (*BasketCheckedOut_Item) GetQuantity ¶
func (x *BasketCheckedOut_Item) GetQuantity() int32
func (*BasketCheckedOut_Item) GetStoreId ¶
func (x *BasketCheckedOut_Item) GetStoreId() string
func (*BasketCheckedOut_Item) GetStoreName ¶
func (x *BasketCheckedOut_Item) GetStoreName() string
func (*BasketCheckedOut_Item) ProtoMessage ¶
func (*BasketCheckedOut_Item) ProtoMessage()
func (*BasketCheckedOut_Item) ProtoReflect ¶
func (x *BasketCheckedOut_Item) ProtoReflect() protoreflect.Message
func (*BasketCheckedOut_Item) Reset ¶
func (x *BasketCheckedOut_Item) Reset()
func (*BasketCheckedOut_Item) String ¶
func (x *BasketCheckedOut_Item) String() string
type BasketServiceClient ¶
type BasketServiceClient interface { StartBasket(ctx context.Context, in *StartBasketRequest, opts ...grpc.CallOption) (*StartBasketResponse, error) CancelBasket(ctx context.Context, in *CancelBasketRequest, opts ...grpc.CallOption) (*CancelBasketResponse, error) CheckoutBasket(ctx context.Context, in *CheckoutBasketRequest, opts ...grpc.CallOption) (*CheckoutBasketResponse, error) AddItem(ctx context.Context, in *AddItemRequest, opts ...grpc.CallOption) (*AddItemResponse, error) RemoveItem(ctx context.Context, in *RemoveItemRequest, opts ...grpc.CallOption) (*RemoveItemResponse, error) GetBasket(ctx context.Context, in *GetBasketRequest, opts ...grpc.CallOption) (*GetBasketResponse, error) }
BasketServiceClient is the client API for BasketService 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 NewBasketServiceClient ¶
func NewBasketServiceClient(cc grpc.ClientConnInterface) BasketServiceClient
type BasketServiceServer ¶
type BasketServiceServer interface { StartBasket(context.Context, *StartBasketRequest) (*StartBasketResponse, error) CancelBasket(context.Context, *CancelBasketRequest) (*CancelBasketResponse, error) CheckoutBasket(context.Context, *CheckoutBasketRequest) (*CheckoutBasketResponse, error) AddItem(context.Context, *AddItemRequest) (*AddItemResponse, error) RemoveItem(context.Context, *RemoveItemRequest) (*RemoveItemResponse, error) GetBasket(context.Context, *GetBasketRequest) (*GetBasketResponse, error) // contains filtered or unexported methods }
BasketServiceServer is the server API for BasketService service. All implementations must embed UnimplementedBasketServiceServer for forward compatibility
type BasketStarted ¶
type BasketStarted struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // contains filtered or unexported fields }
func (*BasketStarted) Descriptor
deprecated
func (*BasketStarted) Descriptor() ([]byte, []int)
Deprecated: Use BasketStarted.ProtoReflect.Descriptor instead.
func (*BasketStarted) GetCustomerId ¶
func (x *BasketStarted) GetCustomerId() string
func (*BasketStarted) GetId ¶
func (x *BasketStarted) GetId() string
func (*BasketStarted) Key ¶
func (*BasketStarted) Key() string
func (*BasketStarted) ProtoMessage ¶
func (*BasketStarted) ProtoMessage()
func (*BasketStarted) ProtoReflect ¶
func (x *BasketStarted) ProtoReflect() protoreflect.Message
func (*BasketStarted) Reset ¶
func (x *BasketStarted) Reset()
func (*BasketStarted) String ¶
func (x *BasketStarted) String() string
type CancelBasketRequest ¶
type CancelBasketRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CancelBasketRequest) Descriptor
deprecated
func (*CancelBasketRequest) Descriptor() ([]byte, []int)
Deprecated: Use CancelBasketRequest.ProtoReflect.Descriptor instead.
func (*CancelBasketRequest) GetId ¶
func (x *CancelBasketRequest) GetId() string
func (*CancelBasketRequest) ProtoMessage ¶
func (*CancelBasketRequest) ProtoMessage()
func (*CancelBasketRequest) ProtoReflect ¶
func (x *CancelBasketRequest) ProtoReflect() protoreflect.Message
func (*CancelBasketRequest) Reset ¶
func (x *CancelBasketRequest) Reset()
func (*CancelBasketRequest) String ¶
func (x *CancelBasketRequest) String() string
type CancelBasketResponse ¶
type CancelBasketResponse struct {
// contains filtered or unexported fields
}
func (*CancelBasketResponse) Descriptor
deprecated
func (*CancelBasketResponse) Descriptor() ([]byte, []int)
Deprecated: Use CancelBasketResponse.ProtoReflect.Descriptor instead.
func (*CancelBasketResponse) ProtoMessage ¶
func (*CancelBasketResponse) ProtoMessage()
func (*CancelBasketResponse) ProtoReflect ¶
func (x *CancelBasketResponse) ProtoReflect() protoreflect.Message
func (*CancelBasketResponse) Reset ¶
func (x *CancelBasketResponse) Reset()
func (*CancelBasketResponse) String ¶
func (x *CancelBasketResponse) String() string
type CheckoutBasketRequest ¶
type CheckoutBasketRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` PaymentId string `protobuf:"bytes,2,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"` // contains filtered or unexported fields }
func (*CheckoutBasketRequest) Descriptor
deprecated
func (*CheckoutBasketRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckoutBasketRequest.ProtoReflect.Descriptor instead.
func (*CheckoutBasketRequest) GetId ¶
func (x *CheckoutBasketRequest) GetId() string
func (*CheckoutBasketRequest) GetPaymentId ¶
func (x *CheckoutBasketRequest) GetPaymentId() string
func (*CheckoutBasketRequest) ProtoMessage ¶
func (*CheckoutBasketRequest) ProtoMessage()
func (*CheckoutBasketRequest) ProtoReflect ¶
func (x *CheckoutBasketRequest) ProtoReflect() protoreflect.Message
func (*CheckoutBasketRequest) Reset ¶
func (x *CheckoutBasketRequest) Reset()
func (*CheckoutBasketRequest) String ¶
func (x *CheckoutBasketRequest) String() string
type CheckoutBasketResponse ¶
type CheckoutBasketResponse struct {
// contains filtered or unexported fields
}
func (*CheckoutBasketResponse) Descriptor
deprecated
func (*CheckoutBasketResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckoutBasketResponse.ProtoReflect.Descriptor instead.
func (*CheckoutBasketResponse) ProtoMessage ¶
func (*CheckoutBasketResponse) ProtoMessage()
func (*CheckoutBasketResponse) ProtoReflect ¶
func (x *CheckoutBasketResponse) ProtoReflect() protoreflect.Message
func (*CheckoutBasketResponse) Reset ¶
func (x *CheckoutBasketResponse) Reset()
func (*CheckoutBasketResponse) String ¶
func (x *CheckoutBasketResponse) String() string
type GetBasketRequest ¶
type GetBasketRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetBasketRequest) Descriptor
deprecated
func (*GetBasketRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBasketRequest.ProtoReflect.Descriptor instead.
func (*GetBasketRequest) GetId ¶
func (x *GetBasketRequest) GetId() string
func (*GetBasketRequest) ProtoMessage ¶
func (*GetBasketRequest) ProtoMessage()
func (*GetBasketRequest) ProtoReflect ¶
func (x *GetBasketRequest) ProtoReflect() protoreflect.Message
func (*GetBasketRequest) Reset ¶
func (x *GetBasketRequest) Reset()
func (*GetBasketRequest) String ¶
func (x *GetBasketRequest) String() string
type GetBasketResponse ¶
type GetBasketResponse struct { Basket *Basket `protobuf:"bytes,1,opt,name=basket,proto3" json:"basket,omitempty"` // contains filtered or unexported fields }
func (*GetBasketResponse) Descriptor
deprecated
func (*GetBasketResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBasketResponse.ProtoReflect.Descriptor instead.
func (*GetBasketResponse) GetBasket ¶
func (x *GetBasketResponse) GetBasket() *Basket
func (*GetBasketResponse) ProtoMessage ¶
func (*GetBasketResponse) ProtoMessage()
func (*GetBasketResponse) ProtoReflect ¶
func (x *GetBasketResponse) ProtoReflect() protoreflect.Message
func (*GetBasketResponse) Reset ¶
func (x *GetBasketResponse) Reset()
func (*GetBasketResponse) String ¶
func (x *GetBasketResponse) String() string
type Item ¶
type Item struct { StoreId string `protobuf:"bytes,1,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` StoreName string `protobuf:"bytes,3,opt,name=store_name,json=storeName,proto3" json:"store_name,omitempty"` ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` ProductPrice float64 `protobuf:"fixed64,5,opt,name=product_price,json=productPrice,proto3" json:"product_price,omitempty"` Quantity int32 `protobuf:"varint,6,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*Item) Descriptor
deprecated
func (*Item) GetProductId ¶
func (*Item) GetProductName ¶
func (*Item) GetProductPrice ¶
func (*Item) GetQuantity ¶
func (*Item) GetStoreId ¶
func (*Item) GetStoreName ¶
func (*Item) ProtoMessage ¶
func (*Item) ProtoMessage()
func (*Item) ProtoReflect ¶
func (x *Item) ProtoReflect() protoreflect.Message
type MockBasketServiceClient ¶
MockBasketServiceClient is an autogenerated mock type for the BasketServiceClient type
func NewMockBasketServiceClient ¶
func NewMockBasketServiceClient(t mockConstructorTestingTNewMockBasketServiceClient) *MockBasketServiceClient
NewMockBasketServiceClient creates a new instance of MockBasketServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockBasketServiceClient) AddItem ¶
func (_m *MockBasketServiceClient) AddItem(ctx context.Context, in *AddItemRequest, opts ...grpc.CallOption) (*AddItemResponse, error)
AddItem provides a mock function with given fields: ctx, in, opts
func (*MockBasketServiceClient) CancelBasket ¶
func (_m *MockBasketServiceClient) CancelBasket(ctx context.Context, in *CancelBasketRequest, opts ...grpc.CallOption) (*CancelBasketResponse, error)
CancelBasket provides a mock function with given fields: ctx, in, opts
func (*MockBasketServiceClient) CheckoutBasket ¶
func (_m *MockBasketServiceClient) CheckoutBasket(ctx context.Context, in *CheckoutBasketRequest, opts ...grpc.CallOption) (*CheckoutBasketResponse, error)
CheckoutBasket provides a mock function with given fields: ctx, in, opts
func (*MockBasketServiceClient) GetBasket ¶
func (_m *MockBasketServiceClient) GetBasket(ctx context.Context, in *GetBasketRequest, opts ...grpc.CallOption) (*GetBasketResponse, error)
GetBasket provides a mock function with given fields: ctx, in, opts
func (*MockBasketServiceClient) RemoveItem ¶
func (_m *MockBasketServiceClient) RemoveItem(ctx context.Context, in *RemoveItemRequest, opts ...grpc.CallOption) (*RemoveItemResponse, error)
RemoveItem provides a mock function with given fields: ctx, in, opts
func (*MockBasketServiceClient) StartBasket ¶
func (_m *MockBasketServiceClient) StartBasket(ctx context.Context, in *StartBasketRequest, opts ...grpc.CallOption) (*StartBasketResponse, error)
StartBasket provides a mock function with given fields: ctx, in, opts
type MockBasketServiceServer ¶
MockBasketServiceServer is an autogenerated mock type for the BasketServiceServer type
func NewMockBasketServiceServer ¶
func NewMockBasketServiceServer(t mockConstructorTestingTNewMockBasketServiceServer) *MockBasketServiceServer
NewMockBasketServiceServer creates a new instance of MockBasketServiceServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockBasketServiceServer) AddItem ¶
func (_m *MockBasketServiceServer) AddItem(_a0 context.Context, _a1 *AddItemRequest) (*AddItemResponse, error)
AddItem provides a mock function with given fields: _a0, _a1
func (*MockBasketServiceServer) CancelBasket ¶
func (_m *MockBasketServiceServer) CancelBasket(_a0 context.Context, _a1 *CancelBasketRequest) (*CancelBasketResponse, error)
CancelBasket provides a mock function with given fields: _a0, _a1
func (*MockBasketServiceServer) CheckoutBasket ¶
func (_m *MockBasketServiceServer) CheckoutBasket(_a0 context.Context, _a1 *CheckoutBasketRequest) (*CheckoutBasketResponse, error)
CheckoutBasket provides a mock function with given fields: _a0, _a1
func (*MockBasketServiceServer) GetBasket ¶
func (_m *MockBasketServiceServer) GetBasket(_a0 context.Context, _a1 *GetBasketRequest) (*GetBasketResponse, error)
GetBasket provides a mock function with given fields: _a0, _a1
func (*MockBasketServiceServer) RemoveItem ¶
func (_m *MockBasketServiceServer) RemoveItem(_a0 context.Context, _a1 *RemoveItemRequest) (*RemoveItemResponse, error)
RemoveItem provides a mock function with given fields: _a0, _a1
func (*MockBasketServiceServer) StartBasket ¶
func (_m *MockBasketServiceServer) StartBasket(_a0 context.Context, _a1 *StartBasketRequest) (*StartBasketResponse, error)
StartBasket provides a mock function with given fields: _a0, _a1
type MockUnsafeBasketServiceServer ¶
MockUnsafeBasketServiceServer is an autogenerated mock type for the UnsafeBasketServiceServer type
func NewMockUnsafeBasketServiceServer ¶
func NewMockUnsafeBasketServiceServer(t mockConstructorTestingTNewMockUnsafeBasketServiceServer) *MockUnsafeBasketServiceServer
NewMockUnsafeBasketServiceServer creates a new instance of MockUnsafeBasketServiceServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type RemoveItemRequest ¶
type RemoveItemRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ProductId string `protobuf:"bytes,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` Quantity int32 `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*RemoveItemRequest) Descriptor
deprecated
func (*RemoveItemRequest) Descriptor() ([]byte, []int)
Deprecated: Use RemoveItemRequest.ProtoReflect.Descriptor instead.
func (*RemoveItemRequest) GetId ¶
func (x *RemoveItemRequest) GetId() string
func (*RemoveItemRequest) GetProductId ¶
func (x *RemoveItemRequest) GetProductId() string
func (*RemoveItemRequest) GetQuantity ¶
func (x *RemoveItemRequest) GetQuantity() int32
func (*RemoveItemRequest) ProtoMessage ¶
func (*RemoveItemRequest) ProtoMessage()
func (*RemoveItemRequest) ProtoReflect ¶
func (x *RemoveItemRequest) ProtoReflect() protoreflect.Message
func (*RemoveItemRequest) Reset ¶
func (x *RemoveItemRequest) Reset()
func (*RemoveItemRequest) String ¶
func (x *RemoveItemRequest) String() string
type RemoveItemResponse ¶
type RemoveItemResponse struct {
// contains filtered or unexported fields
}
func (*RemoveItemResponse) Descriptor
deprecated
func (*RemoveItemResponse) Descriptor() ([]byte, []int)
Deprecated: Use RemoveItemResponse.ProtoReflect.Descriptor instead.
func (*RemoveItemResponse) ProtoMessage ¶
func (*RemoveItemResponse) ProtoMessage()
func (*RemoveItemResponse) ProtoReflect ¶
func (x *RemoveItemResponse) ProtoReflect() protoreflect.Message
func (*RemoveItemResponse) Reset ¶
func (x *RemoveItemResponse) Reset()
func (*RemoveItemResponse) String ¶
func (x *RemoveItemResponse) String() string
type StartBasketRequest ¶
type StartBasketRequest struct { CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // contains filtered or unexported fields }
func (*StartBasketRequest) Descriptor
deprecated
func (*StartBasketRequest) Descriptor() ([]byte, []int)
Deprecated: Use StartBasketRequest.ProtoReflect.Descriptor instead.
func (*StartBasketRequest) GetCustomerId ¶
func (x *StartBasketRequest) GetCustomerId() string
func (*StartBasketRequest) ProtoMessage ¶
func (*StartBasketRequest) ProtoMessage()
func (*StartBasketRequest) ProtoReflect ¶
func (x *StartBasketRequest) ProtoReflect() protoreflect.Message
func (*StartBasketRequest) Reset ¶
func (x *StartBasketRequest) Reset()
func (*StartBasketRequest) String ¶
func (x *StartBasketRequest) String() string
type StartBasketResponse ¶
type StartBasketResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*StartBasketResponse) Descriptor
deprecated
func (*StartBasketResponse) Descriptor() ([]byte, []int)
Deprecated: Use StartBasketResponse.ProtoReflect.Descriptor instead.
func (*StartBasketResponse) GetId ¶
func (x *StartBasketResponse) GetId() string
func (*StartBasketResponse) ProtoMessage ¶
func (*StartBasketResponse) ProtoMessage()
func (*StartBasketResponse) ProtoReflect ¶
func (x *StartBasketResponse) ProtoReflect() protoreflect.Message
func (*StartBasketResponse) Reset ¶
func (x *StartBasketResponse) Reset()
func (*StartBasketResponse) String ¶
func (x *StartBasketResponse) String() string
type UnimplementedBasketServiceServer ¶
type UnimplementedBasketServiceServer struct { }
UnimplementedBasketServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedBasketServiceServer) AddItem ¶
func (UnimplementedBasketServiceServer) AddItem(context.Context, *AddItemRequest) (*AddItemResponse, error)
func (UnimplementedBasketServiceServer) CancelBasket ¶
func (UnimplementedBasketServiceServer) CancelBasket(context.Context, *CancelBasketRequest) (*CancelBasketResponse, error)
func (UnimplementedBasketServiceServer) CheckoutBasket ¶
func (UnimplementedBasketServiceServer) CheckoutBasket(context.Context, *CheckoutBasketRequest) (*CheckoutBasketResponse, error)
func (UnimplementedBasketServiceServer) GetBasket ¶
func (UnimplementedBasketServiceServer) GetBasket(context.Context, *GetBasketRequest) (*GetBasketResponse, error)
func (UnimplementedBasketServiceServer) RemoveItem ¶
func (UnimplementedBasketServiceServer) RemoveItem(context.Context, *RemoveItemRequest) (*RemoveItemResponse, error)
func (UnimplementedBasketServiceServer) StartBasket ¶
func (UnimplementedBasketServiceServer) StartBasket(context.Context, *StartBasketRequest) (*StartBasketResponse, error)
type UnsafeBasketServiceServer ¶
type UnsafeBasketServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBasketServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BasketServiceServer will result in compilation errors.