Documentation ¶
Index ¶
- Variables
- func RegisterProductInfoServer(s grpc.ServiceRegistrar, srv ProductInfoServer)
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetId() string
- func (x *Product) GetName() string
- func (x *Product) GetPrice() float32
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- type ProductID
- type ProductInfoClient
- type ProductInfoServer
- type UnimplementedProductInfoServer
- type UnsafeProductInfoServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_product_proto protoreflect.FileDescriptor
var ProductInfo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ecommerce.v1.ProductInfo", HandlerType: (*ProductInfoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "addProduct", Handler: _ProductInfo_AddProduct_Handler, }, { MethodName: "getProduct", Handler: _ProductInfo_GetProduct_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/product.proto", }
ProductInfo_ServiceDesc is the grpc.ServiceDesc for ProductInfo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProductInfoServer ¶
func RegisterProductInfoServer(s grpc.ServiceRegistrar, srv ProductInfoServer)
Types ¶
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"` Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"` // contains filtered or unexported fields }
func (*Product) Descriptor
deprecated
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
type ProductID ¶
type ProductID struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*ProductID) Descriptor
deprecated
func (*ProductID) ProtoMessage ¶
func (*ProductID) ProtoMessage()
func (*ProductID) ProtoReflect ¶
func (x *ProductID) ProtoReflect() protoreflect.Message
type ProductInfoClient ¶
type ProductInfoClient interface { AddProduct(ctx context.Context, in *Product, opts ...grpc.CallOption) (*ProductID, error) GetProduct(ctx context.Context, in *ProductID, opts ...grpc.CallOption) (*Product, error) }
ProductInfoClient is the client API for ProductInfo 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 NewProductInfoClient ¶
func NewProductInfoClient(cc grpc.ClientConnInterface) ProductInfoClient
type ProductInfoServer ¶
type ProductInfoServer interface { AddProduct(context.Context, *Product) (*ProductID, error) GetProduct(context.Context, *ProductID) (*Product, error) // contains filtered or unexported methods }
ProductInfoServer is the server API for ProductInfo service. All implementations must embed UnimplementedProductInfoServer for forward compatibility
type UnimplementedProductInfoServer ¶
type UnimplementedProductInfoServer struct { }
UnimplementedProductInfoServer must be embedded to have forward compatible implementations.
func (UnimplementedProductInfoServer) AddProduct ¶
func (UnimplementedProductInfoServer) GetProduct ¶
type UnsafeProductInfoServer ¶
type UnsafeProductInfoServer interface {
// contains filtered or unexported methods
}
UnsafeProductInfoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProductInfoServer will result in compilation errors.