Documentation
¶
Index ¶
- Variables
- func RegisterSalesServer(s grpc.ServiceRegistrar, srv SalesServer)
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetCreated() *timestamppb.Timestamp
- func (x *Product) GetName() string
- func (x *Product) GetPrice() float32
- func (x *Product) GetProductId() uint32
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- type ProductIdRequest
- type ProductReply
- type ProductWithSales
- func (*ProductWithSales) Descriptor() ([]byte, []int)deprecated
- func (x *ProductWithSales) GetProduct() uint32
- func (x *ProductWithSales) GetTotalSales() uint32
- func (*ProductWithSales) ProtoMessage()
- func (x *ProductWithSales) ProtoReflect() protoreflect.Message
- func (x *ProductWithSales) Reset()
- func (x *ProductWithSales) String() string
- type Sale
- func (*Sale) Descriptor() ([]byte, []int)deprecated
- func (x *Sale) GetCreated() *timestamppb.Timestamp
- func (x *Sale) GetProductId() uint32
- func (x *Sale) GetQuantity() uint32
- func (x *Sale) GetSaleId() uint32
- func (*Sale) ProtoMessage()
- func (x *Sale) ProtoReflect() protoreflect.Message
- func (x *Sale) Reset()
- func (x *Sale) String() string
- type SalesClient
- type SalesServer
- type UnimplementedSalesServer
- type UnsafeSalesServer
Constants ¶
This section is empty.
Variables ¶
var File_salesservice_proto_sales_proto protoreflect.FileDescriptor
var Sales_ServiceDesc = grpc.ServiceDesc{ ServiceName: "SALES.Sales", HandlerType: (*SalesServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetProductWithHighestSales", Handler: _Sales_GetProductWithHighestSales_Handler, }, { MethodName: "GetSalesForProduct", Handler: _Sales_GetSalesForProduct_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "salesservice/proto/sales.proto", }
Sales_ServiceDesc is the grpc.ServiceDesc for Sales service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSalesServer ¶
func RegisterSalesServer(s grpc.ServiceRegistrar, srv SalesServer)
Types ¶
type Product ¶
type Product struct { ProductId uint32 `protobuf:"varint,1,opt,name=productId,proto3" json:"productId,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"` Created *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"` // contains filtered or unexported fields }
func (*Product) Descriptor
deprecated
func (*Product) GetCreated ¶
func (x *Product) GetCreated() *timestamppb.Timestamp
func (*Product) GetProductId ¶
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
type ProductIdRequest ¶
type ProductIdRequest struct { ProductId uint32 `protobuf:"varint,1,opt,name=productId,proto3" json:"productId,omitempty"` // contains filtered or unexported fields }
func (*ProductIdRequest) Descriptor
deprecated
func (*ProductIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use ProductIdRequest.ProtoReflect.Descriptor instead.
func (*ProductIdRequest) GetProductId ¶
func (x *ProductIdRequest) GetProductId() uint32
func (*ProductIdRequest) ProtoMessage ¶
func (*ProductIdRequest) ProtoMessage()
func (*ProductIdRequest) ProtoReflect ¶
func (x *ProductIdRequest) ProtoReflect() protoreflect.Message
func (*ProductIdRequest) Reset ¶
func (x *ProductIdRequest) Reset()
func (*ProductIdRequest) String ¶
func (x *ProductIdRequest) String() string
type ProductReply ¶
type ProductReply struct { Product []*Product `protobuf:"bytes,1,rep,name=product,proto3" json:"product,omitempty"` // contains filtered or unexported fields }
func (*ProductReply) Descriptor
deprecated
func (*ProductReply) Descriptor() ([]byte, []int)
Deprecated: Use ProductReply.ProtoReflect.Descriptor instead.
func (*ProductReply) GetProduct ¶
func (x *ProductReply) GetProduct() []*Product
func (*ProductReply) ProtoMessage ¶
func (*ProductReply) ProtoMessage()
func (*ProductReply) ProtoReflect ¶
func (x *ProductReply) ProtoReflect() protoreflect.Message
func (*ProductReply) Reset ¶
func (x *ProductReply) Reset()
func (*ProductReply) String ¶
func (x *ProductReply) String() string
type ProductWithSales ¶
type ProductWithSales struct { Product uint32 `protobuf:"varint,1,opt,name=product,proto3" json:"product,omitempty"` TotalSales uint32 `protobuf:"varint,2,opt,name=total_sales,json=totalSales,proto3" json:"total_sales,omitempty"` // contains filtered or unexported fields }
func (*ProductWithSales) Descriptor
deprecated
func (*ProductWithSales) Descriptor() ([]byte, []int)
Deprecated: Use ProductWithSales.ProtoReflect.Descriptor instead.
func (*ProductWithSales) GetProduct ¶
func (x *ProductWithSales) GetProduct() uint32
func (*ProductWithSales) GetTotalSales ¶
func (x *ProductWithSales) GetTotalSales() uint32
func (*ProductWithSales) ProtoMessage ¶
func (*ProductWithSales) ProtoMessage()
func (*ProductWithSales) ProtoReflect ¶
func (x *ProductWithSales) ProtoReflect() protoreflect.Message
func (*ProductWithSales) Reset ¶
func (x *ProductWithSales) Reset()
func (*ProductWithSales) String ¶
func (x *ProductWithSales) String() string
type Sale ¶
type Sale struct { SaleId uint32 `protobuf:"varint,1,opt,name=saleId,proto3" json:"saleId,omitempty"` ProductId uint32 `protobuf:"varint,2,opt,name=productId,proto3" json:"productId,omitempty"` Quantity uint32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` Created *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"` // contains filtered or unexported fields }
func (*Sale) Descriptor
deprecated
func (*Sale) GetCreated ¶
func (x *Sale) GetCreated() *timestamppb.Timestamp
func (*Sale) GetProductId ¶
func (*Sale) GetQuantity ¶
func (*Sale) ProtoMessage ¶
func (*Sale) ProtoMessage()
func (*Sale) ProtoReflect ¶
func (x *Sale) ProtoReflect() protoreflect.Message
type SalesClient ¶
type SalesClient interface { GetProductWithHighestSales(ctx context.Context, in *ProductIdRequest, opts ...grpc.CallOption) (*ProductWithSales, error) GetSalesForProduct(ctx context.Context, in *ProductIdRequest, opts ...grpc.CallOption) (*Sale, error) }
SalesClient is the client API for Sales 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 NewSalesClient ¶
func NewSalesClient(cc grpc.ClientConnInterface) SalesClient
type SalesServer ¶
type SalesServer interface { GetProductWithHighestSales(context.Context, *ProductIdRequest) (*ProductWithSales, error) GetSalesForProduct(context.Context, *ProductIdRequest) (*Sale, error) // contains filtered or unexported methods }
SalesServer is the server API for Sales service. All implementations must embed UnimplementedSalesServer for forward compatibility
type UnimplementedSalesServer ¶
type UnimplementedSalesServer struct { }
UnimplementedSalesServer must be embedded to have forward compatible implementations.
func (UnimplementedSalesServer) GetProductWithHighestSales ¶
func (UnimplementedSalesServer) GetProductWithHighestSales(context.Context, *ProductIdRequest) (*ProductWithSales, error)
func (UnimplementedSalesServer) GetSalesForProduct ¶
func (UnimplementedSalesServer) GetSalesForProduct(context.Context, *ProductIdRequest) (*Sale, error)
type UnsafeSalesServer ¶
type UnsafeSalesServer interface {
// contains filtered or unexported methods
}
UnsafeSalesServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SalesServer will result in compilation errors.