v1

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	CartService_GetCart_FullMethodName    = "/cart.v1.CartService/GetCart"
	CartService_AddItem_FullMethodName    = "/cart.v1.CartService/AddItem"
	CartService_RemoveItem_FullMethodName = "/cart.v1.CartService/RemoveItem"
	CartService_ClearCart_FullMethodName  = "/cart.v1.CartService/ClearCart"
)

Variables

View Source
var CartService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cart.v1.CartService",
	HandlerType: (*CartServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetCart",
			Handler:    _CartService_GetCart_Handler,
		},
		{
			MethodName: "AddItem",
			Handler:    _CartService_AddItem_Handler,
		},
		{
			MethodName: "RemoveItem",
			Handler:    _CartService_RemoveItem_Handler,
		},
		{
			MethodName: "ClearCart",
			Handler:    _CartService_ClearCart_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cart/v1/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)

View Source
var File_cart_v1_cart_proto protoreflect.FileDescriptor

Functions

func RegisterCartServiceHandler added in v1.2.0

func RegisterCartServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCartServiceHandler registers the http handlers for service CartService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCartServiceHandlerClient added in v1.2.0

func RegisterCartServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CartServiceClient) error

RegisterCartServiceHandlerClient registers the http handlers for service CartService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CartServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CartServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CartServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterCartServiceHandlerFromEndpoint added in v1.2.0

func RegisterCartServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCartServiceHandlerFromEndpoint is same as RegisterCartServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCartServiceHandlerServer added in v1.2.0

func RegisterCartServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CartServiceServer) error

RegisterCartServiceHandlerServer registers the http handlers for service CartService to "mux". UnaryRPC :call CartServiceServer 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 RegisterCartServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterCartServiceServer

func RegisterCartServiceServer(s grpc.ServiceRegistrar, srv CartServiceServer)

Types

type AddItemRequest

type AddItemRequest struct {
	UserId    string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	ProductId int64  `protobuf:"varint,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	Quantity  int32  `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

Request to add an item to the cart.

func (*AddItemRequest) Descriptor deprecated

func (*AddItemRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddItemRequest.ProtoReflect.Descriptor instead.

func (*AddItemRequest) GetProductId

func (x *AddItemRequest) GetProductId() int64

func (*AddItemRequest) GetQuantity

func (x *AddItemRequest) GetQuantity() int32

func (*AddItemRequest) GetUserId

func (x *AddItemRequest) GetUserId() string

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

func (*AddItemRequest) Validate added in v1.1.1

func (m *AddItemRequest) Validate() error

Validate checks the field values on AddItemRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AddItemRequest) ValidateAll added in v1.1.1

func (m *AddItemRequest) ValidateAll() error

ValidateAll checks the field values on AddItemRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AddItemRequestMultiError, or nil if none found.

type AddItemRequestMultiError added in v1.1.1

type AddItemRequestMultiError []error

AddItemRequestMultiError is an error wrapping multiple validation errors returned by AddItemRequest.ValidateAll() if the designated constraints aren't met.

func (AddItemRequestMultiError) AllErrors added in v1.1.1

func (m AddItemRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AddItemRequestMultiError) Error added in v1.1.1

func (m AddItemRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AddItemRequestValidationError added in v1.1.1

type AddItemRequestValidationError struct {
	// contains filtered or unexported fields
}

AddItemRequestValidationError is the validation error returned by AddItemRequest.Validate if the designated constraints aren't met.

func (AddItemRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (AddItemRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (AddItemRequestValidationError) ErrorName added in v1.1.1

func (e AddItemRequestValidationError) ErrorName() string

ErrorName returns error name.

func (AddItemRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (AddItemRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (AddItemRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type AddItemResponse

type AddItemResponse struct {
	Cart *Cart `protobuf:"bytes,1,opt,name=cart,proto3" json:"cart,omitempty"`
	// contains filtered or unexported fields
}

Response after adding an item to the cart.

func (*AddItemResponse) Descriptor deprecated

func (*AddItemResponse) Descriptor() ([]byte, []int)

Deprecated: Use AddItemResponse.ProtoReflect.Descriptor instead.

func (*AddItemResponse) GetCart

func (x *AddItemResponse) GetCart() *Cart

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

func (*AddItemResponse) Validate added in v1.1.1

func (m *AddItemResponse) Validate() error

Validate checks the field values on AddItemResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AddItemResponse) ValidateAll added in v1.1.1

func (m *AddItemResponse) ValidateAll() error

ValidateAll checks the field values on AddItemResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AddItemResponseMultiError, or nil if none found.

type AddItemResponseMultiError added in v1.1.1

type AddItemResponseMultiError []error

AddItemResponseMultiError is an error wrapping multiple validation errors returned by AddItemResponse.ValidateAll() if the designated constraints aren't met.

func (AddItemResponseMultiError) AllErrors added in v1.1.1

func (m AddItemResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AddItemResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type AddItemResponseValidationError added in v1.1.1

type AddItemResponseValidationError struct {
	// contains filtered or unexported fields
}

AddItemResponseValidationError is the validation error returned by AddItemResponse.Validate if the designated constraints aren't met.

func (AddItemResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (AddItemResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (AddItemResponseValidationError) ErrorName added in v1.1.1

func (e AddItemResponseValidationError) ErrorName() string

ErrorName returns error name.

func (AddItemResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (AddItemResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (AddItemResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

type Cart

type Cart struct {
	UserId     int64       `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Items      []*CartItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
	TotalPrice float64     `protobuf:"fixed64,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
	// contains filtered or unexported fields
}

The Cart message represents a user's shopping session.

func (*Cart) Descriptor deprecated

func (*Cart) Descriptor() ([]byte, []int)

Deprecated: Use Cart.ProtoReflect.Descriptor instead.

func (*Cart) GetItems

func (x *Cart) GetItems() []*CartItem

func (*Cart) GetTotalPrice

func (x *Cart) GetTotalPrice() float64

func (*Cart) GetUserId

func (x *Cart) GetUserId() int64

func (*Cart) ProtoMessage

func (*Cart) ProtoMessage()

func (*Cart) ProtoReflect

func (x *Cart) ProtoReflect() protoreflect.Message

func (*Cart) Reset

func (x *Cart) Reset()

func (*Cart) String

func (x *Cart) String() string

func (*Cart) Validate added in v1.1.1

func (m *Cart) Validate() error

Validate checks the field values on Cart with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Cart) ValidateAll added in v1.1.1

func (m *Cart) ValidateAll() error

ValidateAll checks the field values on Cart with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CartMultiError, or nil if none found.

type CartItem

type CartItem struct {
	ProductId int64   `protobuf:"varint,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	Quantity  int32   `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"`
	LinePrice float64 `protobuf:"fixed64,3,opt,name=line_price,json=linePrice,proto3" json:"line_price,omitempty"`
	// contains filtered or unexported fields
}

The CartItem message represents a product in the cart.

func (*CartItem) Descriptor deprecated

func (*CartItem) Descriptor() ([]byte, []int)

Deprecated: Use CartItem.ProtoReflect.Descriptor instead.

func (*CartItem) GetLinePrice

func (x *CartItem) GetLinePrice() float64

func (*CartItem) GetProductId

func (x *CartItem) GetProductId() int64

func (*CartItem) GetQuantity

func (x *CartItem) GetQuantity() int32

func (*CartItem) ProtoMessage

func (*CartItem) ProtoMessage()

func (*CartItem) ProtoReflect

func (x *CartItem) ProtoReflect() protoreflect.Message

func (*CartItem) Reset

func (x *CartItem) Reset()

func (*CartItem) String

func (x *CartItem) String() string

func (*CartItem) Validate added in v1.1.1

func (m *CartItem) Validate() error

Validate checks the field values on CartItem with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CartItem) ValidateAll added in v1.1.1

func (m *CartItem) ValidateAll() error

ValidateAll checks the field values on CartItem with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CartItemMultiError, or nil if none found.

type CartItemMultiError added in v1.1.1

type CartItemMultiError []error

CartItemMultiError is an error wrapping multiple validation errors returned by CartItem.ValidateAll() if the designated constraints aren't met.

func (CartItemMultiError) AllErrors added in v1.1.1

func (m CartItemMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CartItemMultiError) Error added in v1.1.1

func (m CartItemMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CartItemValidationError added in v1.1.1

type CartItemValidationError struct {
	// contains filtered or unexported fields
}

CartItemValidationError is the validation error returned by CartItem.Validate if the designated constraints aren't met.

func (CartItemValidationError) Cause added in v1.1.1

func (e CartItemValidationError) Cause() error

Cause function returns cause value.

func (CartItemValidationError) Error added in v1.1.1

func (e CartItemValidationError) Error() string

Error satisfies the builtin error interface

func (CartItemValidationError) ErrorName added in v1.1.1

func (e CartItemValidationError) ErrorName() string

ErrorName returns error name.

func (CartItemValidationError) Field added in v1.1.1

func (e CartItemValidationError) Field() string

Field function returns field value.

func (CartItemValidationError) Key added in v1.1.1

func (e CartItemValidationError) Key() bool

Key function returns key value.

func (CartItemValidationError) Reason added in v1.1.1

func (e CartItemValidationError) Reason() string

Reason function returns reason value.

type CartMultiError added in v1.1.1

type CartMultiError []error

CartMultiError is an error wrapping multiple validation errors returned by Cart.ValidateAll() if the designated constraints aren't met.

func (CartMultiError) AllErrors added in v1.1.1

func (m CartMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CartMultiError) Error added in v1.1.1

func (m CartMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CartServiceClient

type CartServiceClient interface {
	GetCart(ctx context.Context, in *GetCartRequest, opts ...grpc.CallOption) (*GetCartResponse, error)
	AddItem(ctx context.Context, in *AddItemRequest, opts ...grpc.CallOption) (*AddItemResponse, error)
	RemoveItem(ctx context.Context, in *RemoveItemRequest, opts ...grpc.CallOption) (*RemoveItemResponse, error)
	ClearCart(ctx context.Context, in *ClearCartRequest, opts ...grpc.CallOption) (*ClearCartResponse, 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.

CartService provides shopping cart operations.

type CartServiceServer

type CartServiceServer interface {
	GetCart(context.Context, *GetCartRequest) (*GetCartResponse, error)
	AddItem(context.Context, *AddItemRequest) (*AddItemResponse, error)
	RemoveItem(context.Context, *RemoveItemRequest) (*RemoveItemResponse, error)
	ClearCart(context.Context, *ClearCartRequest) (*ClearCartResponse, error)
	// contains filtered or unexported methods
}

CartServiceServer is the server API for CartService service. All implementations must embed UnimplementedCartServiceServer for forward compatibility.

CartService provides shopping cart operations.

type CartValidationError added in v1.1.1

type CartValidationError struct {
	// contains filtered or unexported fields
}

CartValidationError is the validation error returned by Cart.Validate if the designated constraints aren't met.

func (CartValidationError) Cause added in v1.1.1

func (e CartValidationError) Cause() error

Cause function returns cause value.

func (CartValidationError) Error added in v1.1.1

func (e CartValidationError) Error() string

Error satisfies the builtin error interface

func (CartValidationError) ErrorName added in v1.1.1

func (e CartValidationError) ErrorName() string

ErrorName returns error name.

func (CartValidationError) Field added in v1.1.1

func (e CartValidationError) Field() string

Field function returns field value.

func (CartValidationError) Key added in v1.1.1

func (e CartValidationError) Key() bool

Key function returns key value.

func (CartValidationError) Reason added in v1.1.1

func (e CartValidationError) Reason() string

Reason function returns reason value.

type ClearCartRequest

type ClearCartRequest struct {
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Request to clear all items from the cart.

func (*ClearCartRequest) Descriptor deprecated

func (*ClearCartRequest) Descriptor() ([]byte, []int)

Deprecated: Use ClearCartRequest.ProtoReflect.Descriptor instead.

func (*ClearCartRequest) GetUserId

func (x *ClearCartRequest) GetUserId() string

func (*ClearCartRequest) ProtoMessage

func (*ClearCartRequest) ProtoMessage()

func (*ClearCartRequest) ProtoReflect

func (x *ClearCartRequest) ProtoReflect() protoreflect.Message

func (*ClearCartRequest) Reset

func (x *ClearCartRequest) Reset()

func (*ClearCartRequest) String

func (x *ClearCartRequest) String() string

func (*ClearCartRequest) Validate added in v1.1.1

func (m *ClearCartRequest) Validate() error

Validate checks the field values on ClearCartRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ClearCartRequest) ValidateAll added in v1.1.1

func (m *ClearCartRequest) ValidateAll() error

ValidateAll checks the field values on ClearCartRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ClearCartRequestMultiError, or nil if none found.

type ClearCartRequestMultiError added in v1.1.1

type ClearCartRequestMultiError []error

ClearCartRequestMultiError is an error wrapping multiple validation errors returned by ClearCartRequest.ValidateAll() if the designated constraints aren't met.

func (ClearCartRequestMultiError) AllErrors added in v1.1.1

func (m ClearCartRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ClearCartRequestMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type ClearCartRequestValidationError added in v1.1.1

type ClearCartRequestValidationError struct {
	// contains filtered or unexported fields
}

ClearCartRequestValidationError is the validation error returned by ClearCartRequest.Validate if the designated constraints aren't met.

func (ClearCartRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (ClearCartRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (ClearCartRequestValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (ClearCartRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (ClearCartRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (ClearCartRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type ClearCartResponse

type ClearCartResponse struct {
	Cart *Cart `protobuf:"bytes,1,opt,name=cart,proto3" json:"cart,omitempty"`
	// contains filtered or unexported fields
}

Response after clearing the cart.

func (*ClearCartResponse) Descriptor deprecated

func (*ClearCartResponse) Descriptor() ([]byte, []int)

Deprecated: Use ClearCartResponse.ProtoReflect.Descriptor instead.

func (*ClearCartResponse) GetCart

func (x *ClearCartResponse) GetCart() *Cart

func (*ClearCartResponse) ProtoMessage

func (*ClearCartResponse) ProtoMessage()

func (*ClearCartResponse) ProtoReflect

func (x *ClearCartResponse) ProtoReflect() protoreflect.Message

func (*ClearCartResponse) Reset

func (x *ClearCartResponse) Reset()

func (*ClearCartResponse) String

func (x *ClearCartResponse) String() string

func (*ClearCartResponse) Validate added in v1.1.1

func (m *ClearCartResponse) Validate() error

Validate checks the field values on ClearCartResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ClearCartResponse) ValidateAll added in v1.1.1

func (m *ClearCartResponse) ValidateAll() error

ValidateAll checks the field values on ClearCartResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ClearCartResponseMultiError, or nil if none found.

type ClearCartResponseMultiError added in v1.1.1

type ClearCartResponseMultiError []error

ClearCartResponseMultiError is an error wrapping multiple validation errors returned by ClearCartResponse.ValidateAll() if the designated constraints aren't met.

func (ClearCartResponseMultiError) AllErrors added in v1.1.1

func (m ClearCartResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ClearCartResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type ClearCartResponseValidationError added in v1.1.1

type ClearCartResponseValidationError struct {
	// contains filtered or unexported fields
}

ClearCartResponseValidationError is the validation error returned by ClearCartResponse.Validate if the designated constraints aren't met.

func (ClearCartResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (ClearCartResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (ClearCartResponseValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (ClearCartResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (ClearCartResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (ClearCartResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

type GetCartRequest

type GetCartRequest struct {
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Request to get a user's cart.

func (*GetCartRequest) Descriptor deprecated

func (*GetCartRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetCartRequest.ProtoReflect.Descriptor instead.

func (*GetCartRequest) GetUserId

func (x *GetCartRequest) GetUserId() string

func (*GetCartRequest) ProtoMessage

func (*GetCartRequest) ProtoMessage()

func (*GetCartRequest) ProtoReflect

func (x *GetCartRequest) ProtoReflect() protoreflect.Message

func (*GetCartRequest) Reset

func (x *GetCartRequest) Reset()

func (*GetCartRequest) String

func (x *GetCartRequest) String() string

func (*GetCartRequest) Validate added in v1.1.1

func (m *GetCartRequest) Validate() error

Validate checks the field values on GetCartRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetCartRequest) ValidateAll added in v1.1.1

func (m *GetCartRequest) ValidateAll() error

ValidateAll checks the field values on GetCartRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetCartRequestMultiError, or nil if none found.

type GetCartRequestMultiError added in v1.1.1

type GetCartRequestMultiError []error

GetCartRequestMultiError is an error wrapping multiple validation errors returned by GetCartRequest.ValidateAll() if the designated constraints aren't met.

func (GetCartRequestMultiError) AllErrors added in v1.1.1

func (m GetCartRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetCartRequestMultiError) Error added in v1.1.1

func (m GetCartRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetCartRequestValidationError added in v1.1.1

type GetCartRequestValidationError struct {
	// contains filtered or unexported fields
}

GetCartRequestValidationError is the validation error returned by GetCartRequest.Validate if the designated constraints aren't met.

func (GetCartRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (GetCartRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (GetCartRequestValidationError) ErrorName added in v1.1.1

func (e GetCartRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetCartRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (GetCartRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (GetCartRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type GetCartResponse

type GetCartResponse struct {
	Cart *Cart `protobuf:"bytes,1,opt,name=cart,proto3" json:"cart,omitempty"`
	// contains filtered or unexported fields
}

Response for getting a user's cart.

func (*GetCartResponse) Descriptor deprecated

func (*GetCartResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetCartResponse.ProtoReflect.Descriptor instead.

func (*GetCartResponse) GetCart

func (x *GetCartResponse) GetCart() *Cart

func (*GetCartResponse) ProtoMessage

func (*GetCartResponse) ProtoMessage()

func (*GetCartResponse) ProtoReflect

func (x *GetCartResponse) ProtoReflect() protoreflect.Message

func (*GetCartResponse) Reset

func (x *GetCartResponse) Reset()

func (*GetCartResponse) String

func (x *GetCartResponse) String() string

func (*GetCartResponse) Validate added in v1.1.1

func (m *GetCartResponse) Validate() error

Validate checks the field values on GetCartResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetCartResponse) ValidateAll added in v1.1.1

func (m *GetCartResponse) ValidateAll() error

ValidateAll checks the field values on GetCartResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetCartResponseMultiError, or nil if none found.

type GetCartResponseMultiError added in v1.1.1

type GetCartResponseMultiError []error

GetCartResponseMultiError is an error wrapping multiple validation errors returned by GetCartResponse.ValidateAll() if the designated constraints aren't met.

func (GetCartResponseMultiError) AllErrors added in v1.1.1

func (m GetCartResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetCartResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type GetCartResponseValidationError added in v1.1.1

type GetCartResponseValidationError struct {
	// contains filtered or unexported fields
}

GetCartResponseValidationError is the validation error returned by GetCartResponse.Validate if the designated constraints aren't met.

func (GetCartResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (GetCartResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (GetCartResponseValidationError) ErrorName added in v1.1.1

func (e GetCartResponseValidationError) ErrorName() string

ErrorName returns error name.

func (GetCartResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (GetCartResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (GetCartResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

type RemoveItemRequest

type RemoveItemRequest struct {
	UserId    string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	ProductId int64  `protobuf:"varint,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	// contains filtered or unexported fields
}

Request to remove an item from the cart.

func (*RemoveItemRequest) Descriptor deprecated

func (*RemoveItemRequest) Descriptor() ([]byte, []int)

Deprecated: Use RemoveItemRequest.ProtoReflect.Descriptor instead.

func (*RemoveItemRequest) GetProductId

func (x *RemoveItemRequest) GetProductId() int64

func (*RemoveItemRequest) GetUserId

func (x *RemoveItemRequest) GetUserId() string

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

func (*RemoveItemRequest) Validate added in v1.1.1

func (m *RemoveItemRequest) Validate() error

Validate checks the field values on RemoveItemRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RemoveItemRequest) ValidateAll added in v1.1.1

func (m *RemoveItemRequest) ValidateAll() error

ValidateAll checks the field values on RemoveItemRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RemoveItemRequestMultiError, or nil if none found.

type RemoveItemRequestMultiError added in v1.1.1

type RemoveItemRequestMultiError []error

RemoveItemRequestMultiError is an error wrapping multiple validation errors returned by RemoveItemRequest.ValidateAll() if the designated constraints aren't met.

func (RemoveItemRequestMultiError) AllErrors added in v1.1.1

func (m RemoveItemRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RemoveItemRequestMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type RemoveItemRequestValidationError added in v1.1.1

type RemoveItemRequestValidationError struct {
	// contains filtered or unexported fields
}

RemoveItemRequestValidationError is the validation error returned by RemoveItemRequest.Validate if the designated constraints aren't met.

func (RemoveItemRequestValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (RemoveItemRequestValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (RemoveItemRequestValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (RemoveItemRequestValidationError) Field added in v1.1.1

Field function returns field value.

func (RemoveItemRequestValidationError) Key added in v1.1.1

Key function returns key value.

func (RemoveItemRequestValidationError) Reason added in v1.1.1

Reason function returns reason value.

type RemoveItemResponse

type RemoveItemResponse struct {
	Cart *Cart `protobuf:"bytes,1,opt,name=cart,proto3" json:"cart,omitempty"`
	// contains filtered or unexported fields
}

Response after removing an item from the cart.

func (*RemoveItemResponse) Descriptor deprecated

func (*RemoveItemResponse) Descriptor() ([]byte, []int)

Deprecated: Use RemoveItemResponse.ProtoReflect.Descriptor instead.

func (*RemoveItemResponse) GetCart

func (x *RemoveItemResponse) GetCart() *Cart

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

func (*RemoveItemResponse) Validate added in v1.1.1

func (m *RemoveItemResponse) Validate() error

Validate checks the field values on RemoveItemResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RemoveItemResponse) ValidateAll added in v1.1.1

func (m *RemoveItemResponse) ValidateAll() error

ValidateAll checks the field values on RemoveItemResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RemoveItemResponseMultiError, or nil if none found.

type RemoveItemResponseMultiError added in v1.1.1

type RemoveItemResponseMultiError []error

RemoveItemResponseMultiError is an error wrapping multiple validation errors returned by RemoveItemResponse.ValidateAll() if the designated constraints aren't met.

func (RemoveItemResponseMultiError) AllErrors added in v1.1.1

func (m RemoveItemResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RemoveItemResponseMultiError) Error added in v1.1.1

Error returns a concatenation of all the error messages it wraps.

type RemoveItemResponseValidationError added in v1.1.1

type RemoveItemResponseValidationError struct {
	// contains filtered or unexported fields
}

RemoveItemResponseValidationError is the validation error returned by RemoveItemResponse.Validate if the designated constraints aren't met.

func (RemoveItemResponseValidationError) Cause added in v1.1.1

Cause function returns cause value.

func (RemoveItemResponseValidationError) Error added in v1.1.1

Error satisfies the builtin error interface

func (RemoveItemResponseValidationError) ErrorName added in v1.1.1

ErrorName returns error name.

func (RemoveItemResponseValidationError) Field added in v1.1.1

Field function returns field value.

func (RemoveItemResponseValidationError) Key added in v1.1.1

Key function returns key value.

func (RemoveItemResponseValidationError) Reason added in v1.1.1

Reason function returns reason value.

type UnimplementedCartServiceServer

type UnimplementedCartServiceServer struct{}

UnimplementedCartServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedCartServiceServer) AddItem

func (UnimplementedCartServiceServer) ClearCart

func (UnimplementedCartServiceServer) GetCart

func (UnimplementedCartServiceServer) RemoveItem

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL