Documentation
¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterProductServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProductServiceClient) error
- func RegisterProductServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProductServiceServer) error
- func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
- type CreateProductRequest
- func (*CreateProductRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateProductRequest) GetCategory() string
- func (x *CreateProductRequest) GetDescription() string
- func (x *CreateProductRequest) GetInventory() int32
- func (x *CreateProductRequest) GetName() string
- func (x *CreateProductRequest) GetPrice() float64
- func (*CreateProductRequest) ProtoMessage()
- func (x *CreateProductRequest) ProtoReflect() protoreflect.Message
- func (x *CreateProductRequest) Reset()
- func (x *CreateProductRequest) String() string
- func (m *CreateProductRequest) Validate() error
- func (m *CreateProductRequest) ValidateAll() error
- type CreateProductRequestMultiError
- type CreateProductRequestValidationError
- func (e CreateProductRequestValidationError) Cause() error
- func (e CreateProductRequestValidationError) Error() string
- func (e CreateProductRequestValidationError) ErrorName() string
- func (e CreateProductRequestValidationError) Field() string
- func (e CreateProductRequestValidationError) Key() bool
- func (e CreateProductRequestValidationError) Reason() string
- type CreateProductResponse
- func (*CreateProductResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateProductResponse) GetProduct() *Product
- func (*CreateProductResponse) ProtoMessage()
- func (x *CreateProductResponse) ProtoReflect() protoreflect.Message
- func (x *CreateProductResponse) Reset()
- func (x *CreateProductResponse) String() string
- func (m *CreateProductResponse) Validate() error
- func (m *CreateProductResponse) ValidateAll() error
- type CreateProductResponseMultiError
- type CreateProductResponseValidationError
- func (e CreateProductResponseValidationError) Cause() error
- func (e CreateProductResponseValidationError) Error() string
- func (e CreateProductResponseValidationError) ErrorName() string
- func (e CreateProductResponseValidationError) Field() string
- func (e CreateProductResponseValidationError) Key() bool
- func (e CreateProductResponseValidationError) Reason() string
- type GetProductRequest
- func (*GetProductRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetProductRequest) GetId() string
- func (*GetProductRequest) ProtoMessage()
- func (x *GetProductRequest) ProtoReflect() protoreflect.Message
- func (x *GetProductRequest) Reset()
- func (x *GetProductRequest) String() string
- func (m *GetProductRequest) Validate() error
- func (m *GetProductRequest) ValidateAll() error
- type GetProductRequestMultiError
- type GetProductRequestValidationError
- func (e GetProductRequestValidationError) Cause() error
- func (e GetProductRequestValidationError) Error() string
- func (e GetProductRequestValidationError) ErrorName() string
- func (e GetProductRequestValidationError) Field() string
- func (e GetProductRequestValidationError) Key() bool
- func (e GetProductRequestValidationError) Reason() string
- type GetProductResponse
- func (*GetProductResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetProductResponse) GetProduct() *Product
- func (*GetProductResponse) ProtoMessage()
- func (x *GetProductResponse) ProtoReflect() protoreflect.Message
- func (x *GetProductResponse) Reset()
- func (x *GetProductResponse) String() string
- func (m *GetProductResponse) Validate() error
- func (m *GetProductResponse) ValidateAll() error
- type GetProductResponseMultiError
- type GetProductResponseValidationError
- func (e GetProductResponseValidationError) Cause() error
- func (e GetProductResponseValidationError) Error() string
- func (e GetProductResponseValidationError) ErrorName() string
- func (e GetProductResponseValidationError) Field() string
- func (e GetProductResponseValidationError) Key() bool
- func (e GetProductResponseValidationError) Reason() string
- type ListProductsRequest
- func (*ListProductsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListProductsRequest) GetPageSize() int32
- func (x *ListProductsRequest) GetPageToken() string
- func (*ListProductsRequest) ProtoMessage()
- func (x *ListProductsRequest) ProtoReflect() protoreflect.Message
- func (x *ListProductsRequest) Reset()
- func (x *ListProductsRequest) String() string
- func (m *ListProductsRequest) Validate() error
- func (m *ListProductsRequest) ValidateAll() error
- type ListProductsRequestMultiError
- type ListProductsRequestValidationError
- func (e ListProductsRequestValidationError) Cause() error
- func (e ListProductsRequestValidationError) Error() string
- func (e ListProductsRequestValidationError) ErrorName() string
- func (e ListProductsRequestValidationError) Field() string
- func (e ListProductsRequestValidationError) Key() bool
- func (e ListProductsRequestValidationError) Reason() string
- type ListProductsResponse
- func (*ListProductsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListProductsResponse) GetNextPageToken() string
- func (x *ListProductsResponse) GetProducts() []*Product
- func (*ListProductsResponse) ProtoMessage()
- func (x *ListProductsResponse) ProtoReflect() protoreflect.Message
- func (x *ListProductsResponse) Reset()
- func (x *ListProductsResponse) String() string
- func (m *ListProductsResponse) Validate() error
- func (m *ListProductsResponse) ValidateAll() error
- type ListProductsResponseMultiError
- type ListProductsResponseValidationError
- func (e ListProductsResponseValidationError) Cause() error
- func (e ListProductsResponseValidationError) Error() string
- func (e ListProductsResponseValidationError) ErrorName() string
- func (e ListProductsResponseValidationError) Field() string
- func (e ListProductsResponseValidationError) Key() bool
- func (e ListProductsResponseValidationError) Reason() string
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetCategory() string
- func (x *Product) GetCreatedAt() string
- func (x *Product) GetDescription() string
- func (x *Product) GetId() string
- func (x *Product) GetInventory() int32
- func (x *Product) GetName() string
- func (x *Product) GetPrice() float64
- func (x *Product) GetUpdatedAt() string
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- func (m *Product) Validate() error
- func (m *Product) ValidateAll() error
- type ProductMultiError
- type ProductServiceClient
- type ProductServiceServer
- type ProductValidationError
- type UnimplementedProductServiceServer
- func (UnimplementedProductServiceServer) CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
- func (UnimplementedProductServiceServer) GetProduct(context.Context, *GetProductRequest) (*GetProductResponse, error)
- func (UnimplementedProductServiceServer) ListProducts(context.Context, *ListProductsRequest) (*ListProductsResponse, error)
- func (UnimplementedProductServiceServer) UpdateProduct(context.Context, *UpdateProductRequest) (*UpdateProductResponse, error)
- type UnsafeProductServiceServer
- type UpdateProductRequest
- func (*UpdateProductRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateProductRequest) GetCategory() string
- func (x *UpdateProductRequest) GetDescription() string
- func (x *UpdateProductRequest) GetId() string
- func (x *UpdateProductRequest) GetInventory() int32
- func (x *UpdateProductRequest) GetName() string
- func (x *UpdateProductRequest) GetPrice() float64
- func (*UpdateProductRequest) ProtoMessage()
- func (x *UpdateProductRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateProductRequest) Reset()
- func (x *UpdateProductRequest) String() string
- func (m *UpdateProductRequest) Validate() error
- func (m *UpdateProductRequest) ValidateAll() error
- type UpdateProductRequestMultiError
- type UpdateProductRequestValidationError
- func (e UpdateProductRequestValidationError) Cause() error
- func (e UpdateProductRequestValidationError) Error() string
- func (e UpdateProductRequestValidationError) ErrorName() string
- func (e UpdateProductRequestValidationError) Field() string
- func (e UpdateProductRequestValidationError) Key() bool
- func (e UpdateProductRequestValidationError) Reason() string
- type UpdateProductResponse
- func (*UpdateProductResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateProductResponse) GetProduct() *Product
- func (*UpdateProductResponse) ProtoMessage()
- func (x *UpdateProductResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateProductResponse) Reset()
- func (x *UpdateProductResponse) String() string
- func (m *UpdateProductResponse) Validate() error
- func (m *UpdateProductResponse) ValidateAll() error
- type UpdateProductResponseMultiError
- type UpdateProductResponseValidationError
- func (e UpdateProductResponseValidationError) Cause() error
- func (e UpdateProductResponseValidationError) Error() string
- func (e UpdateProductResponseValidationError) ErrorName() string
- func (e UpdateProductResponseValidationError) Field() string
- func (e UpdateProductResponseValidationError) Key() bool
- func (e UpdateProductResponseValidationError) Reason() string
Constants ¶
const ( ProductService_GetProduct_FullMethodName = "/product.v1.ProductService/GetProduct" ProductService_CreateProduct_FullMethodName = "/product.v1.ProductService/CreateProduct" ProductService_UpdateProduct_FullMethodName = "/product.v1.ProductService/UpdateProduct" ProductService_ListProducts_FullMethodName = "/product.v1.ProductService/ListProducts" )
Variables ¶
var File_product_v1_product_proto protoreflect.FileDescriptor
var ProductService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "product.v1.ProductService", HandlerType: (*ProductServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetProduct", Handler: _ProductService_GetProduct_Handler, }, { MethodName: "CreateProduct", Handler: _ProductService_CreateProduct_Handler, }, { MethodName: "UpdateProduct", Handler: _ProductService_UpdateProduct_Handler, }, { MethodName: "ListProducts", Handler: _ProductService_ListProducts_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "product/v1/product.proto", }
ProductService_ServiceDesc is the grpc.ServiceDesc for ProductService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProductServiceHandler ¶ added in v1.2.0
func RegisterProductServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterProductServiceHandler registers the http handlers for service ProductService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterProductServiceHandlerClient ¶ added in v1.2.0
func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProductServiceClient) error
RegisterProductServiceHandlerClient registers the http handlers for service ProductService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProductServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProductServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProductServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterProductServiceHandlerFromEndpoint ¶ added in v1.2.0
func RegisterProductServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterProductServiceHandlerFromEndpoint is same as RegisterProductServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterProductServiceHandlerServer ¶ added in v1.2.0
func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProductServiceServer) error
RegisterProductServiceHandlerServer registers the http handlers for service ProductService to "mux". UnaryRPC :call ProductServiceServer 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 RegisterProductServiceHandlerFromEndpoint 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 RegisterProductServiceServer ¶
func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
Types ¶
type CreateProductRequest ¶
type CreateProductRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Price float64 `protobuf:"fixed64,3,opt,name=price,proto3" json:"price,omitempty"`
Inventory int32 `protobuf:"varint,4,opt,name=inventory,proto3" json:"inventory,omitempty"`
Category string `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"`
// contains filtered or unexported fields
}
Request to create a new product.
func (*CreateProductRequest) Descriptor
deprecated
func (*CreateProductRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateProductRequest.ProtoReflect.Descriptor instead.
func (*CreateProductRequest) GetCategory ¶
func (x *CreateProductRequest) GetCategory() string
func (*CreateProductRequest) GetDescription ¶
func (x *CreateProductRequest) GetDescription() string
func (*CreateProductRequest) GetInventory ¶
func (x *CreateProductRequest) GetInventory() int32
func (*CreateProductRequest) GetName ¶
func (x *CreateProductRequest) GetName() string
func (*CreateProductRequest) GetPrice ¶
func (x *CreateProductRequest) GetPrice() float64
func (*CreateProductRequest) ProtoMessage ¶
func (*CreateProductRequest) ProtoMessage()
func (*CreateProductRequest) ProtoReflect ¶
func (x *CreateProductRequest) ProtoReflect() protoreflect.Message
func (*CreateProductRequest) Reset ¶
func (x *CreateProductRequest) Reset()
func (*CreateProductRequest) String ¶
func (x *CreateProductRequest) String() string
func (*CreateProductRequest) Validate ¶ added in v1.1.1
func (m *CreateProductRequest) Validate() error
Validate checks the field values on CreateProductRequest 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 (*CreateProductRequest) ValidateAll ¶ added in v1.1.1
func (m *CreateProductRequest) ValidateAll() error
ValidateAll checks the field values on CreateProductRequest 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 CreateProductRequestMultiError, or nil if none found.
type CreateProductRequestMultiError ¶ added in v1.1.1
type CreateProductRequestMultiError []error
CreateProductRequestMultiError is an error wrapping multiple validation errors returned by CreateProductRequest.ValidateAll() if the designated constraints aren't met.
func (CreateProductRequestMultiError) AllErrors ¶ added in v1.1.1
func (m CreateProductRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateProductRequestMultiError) Error ¶ added in v1.1.1
func (m CreateProductRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateProductRequestValidationError ¶ added in v1.1.1
type CreateProductRequestValidationError struct {
// contains filtered or unexported fields
}
CreateProductRequestValidationError is the validation error returned by CreateProductRequest.Validate if the designated constraints aren't met.
func (CreateProductRequestValidationError) Cause ¶ added in v1.1.1
func (e CreateProductRequestValidationError) Cause() error
Cause function returns cause value.
func (CreateProductRequestValidationError) Error ¶ added in v1.1.1
func (e CreateProductRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CreateProductRequestValidationError) ErrorName ¶ added in v1.1.1
func (e CreateProductRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CreateProductRequestValidationError) Field ¶ added in v1.1.1
func (e CreateProductRequestValidationError) Field() string
Field function returns field value.
func (CreateProductRequestValidationError) Key ¶ added in v1.1.1
func (e CreateProductRequestValidationError) Key() bool
Key function returns key value.
func (CreateProductRequestValidationError) Reason ¶ added in v1.1.1
func (e CreateProductRequestValidationError) Reason() string
Reason function returns reason value.
type CreateProductResponse ¶
type CreateProductResponse struct {
Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
// contains filtered or unexported fields
}
Response for creating a product.
func (*CreateProductResponse) Descriptor
deprecated
func (*CreateProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateProductResponse.ProtoReflect.Descriptor instead.
func (*CreateProductResponse) GetProduct ¶
func (x *CreateProductResponse) GetProduct() *Product
func (*CreateProductResponse) ProtoMessage ¶
func (*CreateProductResponse) ProtoMessage()
func (*CreateProductResponse) ProtoReflect ¶
func (x *CreateProductResponse) ProtoReflect() protoreflect.Message
func (*CreateProductResponse) Reset ¶
func (x *CreateProductResponse) Reset()
func (*CreateProductResponse) String ¶
func (x *CreateProductResponse) String() string
func (*CreateProductResponse) Validate ¶ added in v1.1.1
func (m *CreateProductResponse) Validate() error
Validate checks the field values on CreateProductResponse 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 (*CreateProductResponse) ValidateAll ¶ added in v1.1.1
func (m *CreateProductResponse) ValidateAll() error
ValidateAll checks the field values on CreateProductResponse 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 CreateProductResponseMultiError, or nil if none found.
type CreateProductResponseMultiError ¶ added in v1.1.1
type CreateProductResponseMultiError []error
CreateProductResponseMultiError is an error wrapping multiple validation errors returned by CreateProductResponse.ValidateAll() if the designated constraints aren't met.
func (CreateProductResponseMultiError) AllErrors ¶ added in v1.1.1
func (m CreateProductResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateProductResponseMultiError) Error ¶ added in v1.1.1
func (m CreateProductResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateProductResponseValidationError ¶ added in v1.1.1
type CreateProductResponseValidationError struct {
// contains filtered or unexported fields
}
CreateProductResponseValidationError is the validation error returned by CreateProductResponse.Validate if the designated constraints aren't met.
func (CreateProductResponseValidationError) Cause ¶ added in v1.1.1
func (e CreateProductResponseValidationError) Cause() error
Cause function returns cause value.
func (CreateProductResponseValidationError) Error ¶ added in v1.1.1
func (e CreateProductResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CreateProductResponseValidationError) ErrorName ¶ added in v1.1.1
func (e CreateProductResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CreateProductResponseValidationError) Field ¶ added in v1.1.1
func (e CreateProductResponseValidationError) Field() string
Field function returns field value.
func (CreateProductResponseValidationError) Key ¶ added in v1.1.1
func (e CreateProductResponseValidationError) Key() bool
Key function returns key value.
func (CreateProductResponseValidationError) Reason ¶ added in v1.1.1
func (e CreateProductResponseValidationError) Reason() string
Reason function returns reason value.
type GetProductRequest ¶
type GetProductRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
Request to get a product by ID.
func (*GetProductRequest) Descriptor
deprecated
func (*GetProductRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetProductRequest.ProtoReflect.Descriptor instead.
func (*GetProductRequest) GetId ¶
func (x *GetProductRequest) GetId() string
func (*GetProductRequest) ProtoMessage ¶
func (*GetProductRequest) ProtoMessage()
func (*GetProductRequest) ProtoReflect ¶
func (x *GetProductRequest) ProtoReflect() protoreflect.Message
func (*GetProductRequest) Reset ¶
func (x *GetProductRequest) Reset()
func (*GetProductRequest) String ¶
func (x *GetProductRequest) String() string
func (*GetProductRequest) Validate ¶ added in v1.1.1
func (m *GetProductRequest) Validate() error
Validate checks the field values on GetProductRequest 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 (*GetProductRequest) ValidateAll ¶ added in v1.1.1
func (m *GetProductRequest) ValidateAll() error
ValidateAll checks the field values on GetProductRequest 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 GetProductRequestMultiError, or nil if none found.
type GetProductRequestMultiError ¶ added in v1.1.1
type GetProductRequestMultiError []error
GetProductRequestMultiError is an error wrapping multiple validation errors returned by GetProductRequest.ValidateAll() if the designated constraints aren't met.
func (GetProductRequestMultiError) AllErrors ¶ added in v1.1.1
func (m GetProductRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetProductRequestMultiError) Error ¶ added in v1.1.1
func (m GetProductRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetProductRequestValidationError ¶ added in v1.1.1
type GetProductRequestValidationError struct {
// contains filtered or unexported fields
}
GetProductRequestValidationError is the validation error returned by GetProductRequest.Validate if the designated constraints aren't met.
func (GetProductRequestValidationError) Cause ¶ added in v1.1.1
func (e GetProductRequestValidationError) Cause() error
Cause function returns cause value.
func (GetProductRequestValidationError) Error ¶ added in v1.1.1
func (e GetProductRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetProductRequestValidationError) ErrorName ¶ added in v1.1.1
func (e GetProductRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetProductRequestValidationError) Field ¶ added in v1.1.1
func (e GetProductRequestValidationError) Field() string
Field function returns field value.
func (GetProductRequestValidationError) Key ¶ added in v1.1.1
func (e GetProductRequestValidationError) Key() bool
Key function returns key value.
func (GetProductRequestValidationError) Reason ¶ added in v1.1.1
func (e GetProductRequestValidationError) Reason() string
Reason function returns reason value.
type GetProductResponse ¶
type GetProductResponse struct {
Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
// contains filtered or unexported fields
}
Response for getting a product.
func (*GetProductResponse) Descriptor
deprecated
func (*GetProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetProductResponse.ProtoReflect.Descriptor instead.
func (*GetProductResponse) GetProduct ¶
func (x *GetProductResponse) GetProduct() *Product
func (*GetProductResponse) ProtoMessage ¶
func (*GetProductResponse) ProtoMessage()
func (*GetProductResponse) ProtoReflect ¶
func (x *GetProductResponse) ProtoReflect() protoreflect.Message
func (*GetProductResponse) Reset ¶
func (x *GetProductResponse) Reset()
func (*GetProductResponse) String ¶
func (x *GetProductResponse) String() string
func (*GetProductResponse) Validate ¶ added in v1.1.1
func (m *GetProductResponse) Validate() error
Validate checks the field values on GetProductResponse 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 (*GetProductResponse) ValidateAll ¶ added in v1.1.1
func (m *GetProductResponse) ValidateAll() error
ValidateAll checks the field values on GetProductResponse 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 GetProductResponseMultiError, or nil if none found.
type GetProductResponseMultiError ¶ added in v1.1.1
type GetProductResponseMultiError []error
GetProductResponseMultiError is an error wrapping multiple validation errors returned by GetProductResponse.ValidateAll() if the designated constraints aren't met.
func (GetProductResponseMultiError) AllErrors ¶ added in v1.1.1
func (m GetProductResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetProductResponseMultiError) Error ¶ added in v1.1.1
func (m GetProductResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetProductResponseValidationError ¶ added in v1.1.1
type GetProductResponseValidationError struct {
// contains filtered or unexported fields
}
GetProductResponseValidationError is the validation error returned by GetProductResponse.Validate if the designated constraints aren't met.
func (GetProductResponseValidationError) Cause ¶ added in v1.1.1
func (e GetProductResponseValidationError) Cause() error
Cause function returns cause value.
func (GetProductResponseValidationError) Error ¶ added in v1.1.1
func (e GetProductResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetProductResponseValidationError) ErrorName ¶ added in v1.1.1
func (e GetProductResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetProductResponseValidationError) Field ¶ added in v1.1.1
func (e GetProductResponseValidationError) Field() string
Field function returns field value.
func (GetProductResponseValidationError) Key ¶ added in v1.1.1
func (e GetProductResponseValidationError) Key() bool
Key function returns key value.
func (GetProductResponseValidationError) Reason ¶ added in v1.1.1
func (e GetProductResponseValidationError) Reason() string
Reason function returns reason value.
type ListProductsRequest ¶
type ListProductsRequest struct {
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// contains filtered or unexported fields
}
Request to list products, with optional pagination.
func (*ListProductsRequest) Descriptor
deprecated
func (*ListProductsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListProductsRequest.ProtoReflect.Descriptor instead.
func (*ListProductsRequest) GetPageSize ¶
func (x *ListProductsRequest) GetPageSize() int32
func (*ListProductsRequest) GetPageToken ¶
func (x *ListProductsRequest) GetPageToken() string
func (*ListProductsRequest) ProtoMessage ¶
func (*ListProductsRequest) ProtoMessage()
func (*ListProductsRequest) ProtoReflect ¶
func (x *ListProductsRequest) ProtoReflect() protoreflect.Message
func (*ListProductsRequest) Reset ¶
func (x *ListProductsRequest) Reset()
func (*ListProductsRequest) String ¶
func (x *ListProductsRequest) String() string
func (*ListProductsRequest) Validate ¶ added in v1.1.1
func (m *ListProductsRequest) Validate() error
Validate checks the field values on ListProductsRequest 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 (*ListProductsRequest) ValidateAll ¶ added in v1.1.1
func (m *ListProductsRequest) ValidateAll() error
ValidateAll checks the field values on ListProductsRequest 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 ListProductsRequestMultiError, or nil if none found.
type ListProductsRequestMultiError ¶ added in v1.1.1
type ListProductsRequestMultiError []error
ListProductsRequestMultiError is an error wrapping multiple validation errors returned by ListProductsRequest.ValidateAll() if the designated constraints aren't met.
func (ListProductsRequestMultiError) AllErrors ¶ added in v1.1.1
func (m ListProductsRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ListProductsRequestMultiError) Error ¶ added in v1.1.1
func (m ListProductsRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ListProductsRequestValidationError ¶ added in v1.1.1
type ListProductsRequestValidationError struct {
// contains filtered or unexported fields
}
ListProductsRequestValidationError is the validation error returned by ListProductsRequest.Validate if the designated constraints aren't met.
func (ListProductsRequestValidationError) Cause ¶ added in v1.1.1
func (e ListProductsRequestValidationError) Cause() error
Cause function returns cause value.
func (ListProductsRequestValidationError) Error ¶ added in v1.1.1
func (e ListProductsRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ListProductsRequestValidationError) ErrorName ¶ added in v1.1.1
func (e ListProductsRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ListProductsRequestValidationError) Field ¶ added in v1.1.1
func (e ListProductsRequestValidationError) Field() string
Field function returns field value.
func (ListProductsRequestValidationError) Key ¶ added in v1.1.1
func (e ListProductsRequestValidationError) Key() bool
Key function returns key value.
func (ListProductsRequestValidationError) Reason ¶ added in v1.1.1
func (e ListProductsRequestValidationError) Reason() string
Reason function returns reason value.
type ListProductsResponse ¶
type ListProductsResponse struct {
Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"`
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// contains filtered or unexported fields
}
Response for listing products.
func (*ListProductsResponse) Descriptor
deprecated
func (*ListProductsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListProductsResponse.ProtoReflect.Descriptor instead.
func (*ListProductsResponse) GetNextPageToken ¶
func (x *ListProductsResponse) GetNextPageToken() string
func (*ListProductsResponse) GetProducts ¶
func (x *ListProductsResponse) GetProducts() []*Product
func (*ListProductsResponse) ProtoMessage ¶
func (*ListProductsResponse) ProtoMessage()
func (*ListProductsResponse) ProtoReflect ¶
func (x *ListProductsResponse) ProtoReflect() protoreflect.Message
func (*ListProductsResponse) Reset ¶
func (x *ListProductsResponse) Reset()
func (*ListProductsResponse) String ¶
func (x *ListProductsResponse) String() string
func (*ListProductsResponse) Validate ¶ added in v1.1.1
func (m *ListProductsResponse) Validate() error
Validate checks the field values on ListProductsResponse 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 (*ListProductsResponse) ValidateAll ¶ added in v1.1.1
func (m *ListProductsResponse) ValidateAll() error
ValidateAll checks the field values on ListProductsResponse 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 ListProductsResponseMultiError, or nil if none found.
type ListProductsResponseMultiError ¶ added in v1.1.1
type ListProductsResponseMultiError []error
ListProductsResponseMultiError is an error wrapping multiple validation errors returned by ListProductsResponse.ValidateAll() if the designated constraints aren't met.
func (ListProductsResponseMultiError) AllErrors ¶ added in v1.1.1
func (m ListProductsResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ListProductsResponseMultiError) Error ¶ added in v1.1.1
func (m ListProductsResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ListProductsResponseValidationError ¶ added in v1.1.1
type ListProductsResponseValidationError struct {
// contains filtered or unexported fields
}
ListProductsResponseValidationError is the validation error returned by ListProductsResponse.Validate if the designated constraints aren't met.
func (ListProductsResponseValidationError) Cause ¶ added in v1.1.1
func (e ListProductsResponseValidationError) Cause() error
Cause function returns cause value.
func (ListProductsResponseValidationError) Error ¶ added in v1.1.1
func (e ListProductsResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ListProductsResponseValidationError) ErrorName ¶ added in v1.1.1
func (e ListProductsResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ListProductsResponseValidationError) Field ¶ added in v1.1.1
func (e ListProductsResponseValidationError) Field() string
Field function returns field value.
func (ListProductsResponseValidationError) Key ¶ added in v1.1.1
func (e ListProductsResponseValidationError) Key() bool
Key function returns key value.
func (ListProductsResponseValidationError) Reason ¶ added in v1.1.1
func (e ListProductsResponseValidationError) Reason() string
Reason function returns reason value.
type Product ¶
type Product struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Price float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"`
Inventory int32 `protobuf:"varint,5,opt,name=inventory,proto3" json:"inventory,omitempty"`
Category string `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"`
CreatedAt string `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
// contains filtered or unexported fields
}
The Product message represents an e-commerce product.
func (*Product) Descriptor
deprecated
func (*Product) GetCategory ¶
func (*Product) GetCreatedAt ¶
func (*Product) GetDescription ¶
func (*Product) GetInventory ¶
func (*Product) GetUpdatedAt ¶
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
func (*Product) Validate ¶ added in v1.1.1
Validate checks the field values on Product 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 (*Product) ValidateAll ¶ added in v1.1.1
ValidateAll checks the field values on Product 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 ProductMultiError, or nil if none found.
type ProductMultiError ¶ added in v1.1.1
type ProductMultiError []error
ProductMultiError is an error wrapping multiple validation errors returned by Product.ValidateAll() if the designated constraints aren't met.
func (ProductMultiError) AllErrors ¶ added in v1.1.1
func (m ProductMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ProductMultiError) Error ¶ added in v1.1.1
func (m ProductMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ProductServiceClient ¶
type ProductServiceClient interface {
GetProduct(ctx context.Context, in *GetProductRequest, opts ...grpc.CallOption) (*GetProductResponse, error)
CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...grpc.CallOption) (*CreateProductResponse, error)
UpdateProduct(ctx context.Context, in *UpdateProductRequest, opts ...grpc.CallOption) (*UpdateProductResponse, error)
ListProducts(ctx context.Context, in *ListProductsRequest, opts ...grpc.CallOption) (*ListProductsResponse, error)
}
ProductServiceClient is the client API for ProductService 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.
ProductService provides product management operations.
func NewProductServiceClient ¶
func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient
type ProductServiceServer ¶
type ProductServiceServer interface {
GetProduct(context.Context, *GetProductRequest) (*GetProductResponse, error)
CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
UpdateProduct(context.Context, *UpdateProductRequest) (*UpdateProductResponse, error)
ListProducts(context.Context, *ListProductsRequest) (*ListProductsResponse, error)
// contains filtered or unexported methods
}
ProductServiceServer is the server API for ProductService service. All implementations must embed UnimplementedProductServiceServer for forward compatibility.
ProductService provides product management operations.
type ProductValidationError ¶ added in v1.1.1
type ProductValidationError struct {
// contains filtered or unexported fields
}
ProductValidationError is the validation error returned by Product.Validate if the designated constraints aren't met.
func (ProductValidationError) Cause ¶ added in v1.1.1
func (e ProductValidationError) Cause() error
Cause function returns cause value.
func (ProductValidationError) Error ¶ added in v1.1.1
func (e ProductValidationError) Error() string
Error satisfies the builtin error interface
func (ProductValidationError) ErrorName ¶ added in v1.1.1
func (e ProductValidationError) ErrorName() string
ErrorName returns error name.
func (ProductValidationError) Field ¶ added in v1.1.1
func (e ProductValidationError) Field() string
Field function returns field value.
func (ProductValidationError) Key ¶ added in v1.1.1
func (e ProductValidationError) Key() bool
Key function returns key value.
func (ProductValidationError) Reason ¶ added in v1.1.1
func (e ProductValidationError) Reason() string
Reason function returns reason value.
type UnimplementedProductServiceServer ¶
type UnimplementedProductServiceServer struct{}
UnimplementedProductServiceServer 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 (UnimplementedProductServiceServer) CreateProduct ¶
func (UnimplementedProductServiceServer) CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
func (UnimplementedProductServiceServer) GetProduct ¶
func (UnimplementedProductServiceServer) GetProduct(context.Context, *GetProductRequest) (*GetProductResponse, error)
func (UnimplementedProductServiceServer) ListProducts ¶
func (UnimplementedProductServiceServer) ListProducts(context.Context, *ListProductsRequest) (*ListProductsResponse, error)
func (UnimplementedProductServiceServer) UpdateProduct ¶
func (UnimplementedProductServiceServer) UpdateProduct(context.Context, *UpdateProductRequest) (*UpdateProductResponse, error)
type UnsafeProductServiceServer ¶
type UnsafeProductServiceServer interface {
// contains filtered or unexported methods
}
UnsafeProductServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProductServiceServer will result in compilation errors.
type UpdateProductRequest ¶
type UpdateProductRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Price float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"`
Inventory int32 `protobuf:"varint,5,opt,name=inventory,proto3" json:"inventory,omitempty"`
Category string `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"`
// contains filtered or unexported fields
}
Request to update an existing product.
func (*UpdateProductRequest) Descriptor
deprecated
func (*UpdateProductRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateProductRequest.ProtoReflect.Descriptor instead.
func (*UpdateProductRequest) GetCategory ¶
func (x *UpdateProductRequest) GetCategory() string
func (*UpdateProductRequest) GetDescription ¶
func (x *UpdateProductRequest) GetDescription() string
func (*UpdateProductRequest) GetId ¶
func (x *UpdateProductRequest) GetId() string
func (*UpdateProductRequest) GetInventory ¶
func (x *UpdateProductRequest) GetInventory() int32
func (*UpdateProductRequest) GetName ¶
func (x *UpdateProductRequest) GetName() string
func (*UpdateProductRequest) GetPrice ¶
func (x *UpdateProductRequest) GetPrice() float64
func (*UpdateProductRequest) ProtoMessage ¶
func (*UpdateProductRequest) ProtoMessage()
func (*UpdateProductRequest) ProtoReflect ¶
func (x *UpdateProductRequest) ProtoReflect() protoreflect.Message
func (*UpdateProductRequest) Reset ¶
func (x *UpdateProductRequest) Reset()
func (*UpdateProductRequest) String ¶
func (x *UpdateProductRequest) String() string
func (*UpdateProductRequest) Validate ¶ added in v1.1.1
func (m *UpdateProductRequest) Validate() error
Validate checks the field values on UpdateProductRequest 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 (*UpdateProductRequest) ValidateAll ¶ added in v1.1.1
func (m *UpdateProductRequest) ValidateAll() error
ValidateAll checks the field values on UpdateProductRequest 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 UpdateProductRequestMultiError, or nil if none found.
type UpdateProductRequestMultiError ¶ added in v1.1.1
type UpdateProductRequestMultiError []error
UpdateProductRequestMultiError is an error wrapping multiple validation errors returned by UpdateProductRequest.ValidateAll() if the designated constraints aren't met.
func (UpdateProductRequestMultiError) AllErrors ¶ added in v1.1.1
func (m UpdateProductRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UpdateProductRequestMultiError) Error ¶ added in v1.1.1
func (m UpdateProductRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UpdateProductRequestValidationError ¶ added in v1.1.1
type UpdateProductRequestValidationError struct {
// contains filtered or unexported fields
}
UpdateProductRequestValidationError is the validation error returned by UpdateProductRequest.Validate if the designated constraints aren't met.
func (UpdateProductRequestValidationError) Cause ¶ added in v1.1.1
func (e UpdateProductRequestValidationError) Cause() error
Cause function returns cause value.
func (UpdateProductRequestValidationError) Error ¶ added in v1.1.1
func (e UpdateProductRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UpdateProductRequestValidationError) ErrorName ¶ added in v1.1.1
func (e UpdateProductRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UpdateProductRequestValidationError) Field ¶ added in v1.1.1
func (e UpdateProductRequestValidationError) Field() string
Field function returns field value.
func (UpdateProductRequestValidationError) Key ¶ added in v1.1.1
func (e UpdateProductRequestValidationError) Key() bool
Key function returns key value.
func (UpdateProductRequestValidationError) Reason ¶ added in v1.1.1
func (e UpdateProductRequestValidationError) Reason() string
Reason function returns reason value.
type UpdateProductResponse ¶
type UpdateProductResponse struct {
Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
// contains filtered or unexported fields
}
Response for updating a product.
func (*UpdateProductResponse) Descriptor
deprecated
func (*UpdateProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateProductResponse.ProtoReflect.Descriptor instead.
func (*UpdateProductResponse) GetProduct ¶
func (x *UpdateProductResponse) GetProduct() *Product
func (*UpdateProductResponse) ProtoMessage ¶
func (*UpdateProductResponse) ProtoMessage()
func (*UpdateProductResponse) ProtoReflect ¶
func (x *UpdateProductResponse) ProtoReflect() protoreflect.Message
func (*UpdateProductResponse) Reset ¶
func (x *UpdateProductResponse) Reset()
func (*UpdateProductResponse) String ¶
func (x *UpdateProductResponse) String() string
func (*UpdateProductResponse) Validate ¶ added in v1.1.1
func (m *UpdateProductResponse) Validate() error
Validate checks the field values on UpdateProductResponse 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 (*UpdateProductResponse) ValidateAll ¶ added in v1.1.1
func (m *UpdateProductResponse) ValidateAll() error
ValidateAll checks the field values on UpdateProductResponse 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 UpdateProductResponseMultiError, or nil if none found.
type UpdateProductResponseMultiError ¶ added in v1.1.1
type UpdateProductResponseMultiError []error
UpdateProductResponseMultiError is an error wrapping multiple validation errors returned by UpdateProductResponse.ValidateAll() if the designated constraints aren't met.
func (UpdateProductResponseMultiError) AllErrors ¶ added in v1.1.1
func (m UpdateProductResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UpdateProductResponseMultiError) Error ¶ added in v1.1.1
func (m UpdateProductResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UpdateProductResponseValidationError ¶ added in v1.1.1
type UpdateProductResponseValidationError struct {
// contains filtered or unexported fields
}
UpdateProductResponseValidationError is the validation error returned by UpdateProductResponse.Validate if the designated constraints aren't met.
func (UpdateProductResponseValidationError) Cause ¶ added in v1.1.1
func (e UpdateProductResponseValidationError) Cause() error
Cause function returns cause value.
func (UpdateProductResponseValidationError) Error ¶ added in v1.1.1
func (e UpdateProductResponseValidationError) Error() string
Error satisfies the builtin error interface
func (UpdateProductResponseValidationError) ErrorName ¶ added in v1.1.1
func (e UpdateProductResponseValidationError) ErrorName() string
ErrorName returns error name.
func (UpdateProductResponseValidationError) Field ¶ added in v1.1.1
func (e UpdateProductResponseValidationError) Field() string
Field function returns field value.
func (UpdateProductResponseValidationError) Key ¶ added in v1.1.1
func (e UpdateProductResponseValidationError) Key() bool
Key function returns key value.
func (UpdateProductResponseValidationError) Reason ¶ added in v1.1.1
func (e UpdateProductResponseValidationError) Reason() string
Reason function returns reason value.