gen

package
v0.0.0-...-f8c27d3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_salesservice_proto_sales_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Product.ProtoReflect.Descriptor instead.

func (*Product) GetCreated

func (x *Product) GetCreated() *timestamppb.Timestamp

func (*Product) GetName

func (x *Product) GetName() string

func (*Product) GetPrice

func (x *Product) GetPrice() float32

func (*Product) GetProductId

func (x *Product) GetProductId() uint32

func (*Product) ProtoMessage

func (*Product) ProtoMessage()

func (*Product) ProtoReflect

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

func (*Product) Reset

func (x *Product) Reset()

func (*Product) String

func (x *Product) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Sale.ProtoReflect.Descriptor instead.

func (*Sale) GetCreated

func (x *Sale) GetCreated() *timestamppb.Timestamp

func (*Sale) GetProductId

func (x *Sale) GetProductId() uint32

func (*Sale) GetQuantity

func (x *Sale) GetQuantity() uint32

func (*Sale) GetSaleId

func (x *Sale) GetSaleId() uint32

func (*Sale) ProtoMessage

func (*Sale) ProtoMessage()

func (*Sale) ProtoReflect

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

func (*Sale) Reset

func (x *Sale) Reset()

func (*Sale) String

func (x *Sale) String() string

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) GetSalesForProduct

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.

Jump to

Keyboard shortcuts

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