Documentation ¶
Index ¶
- Variables
- func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
- type CreateProductRequest
- func (*CreateProductRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateProductRequest) GetName() string
- func (x *CreateProductRequest) GetPrice() int64
- func (x *CreateProductRequest) GetStock() int64
- func (*CreateProductRequest) ProtoMessage()
- func (x *CreateProductRequest) ProtoReflect() protoreflect.Message
- func (x *CreateProductRequest) Reset()
- func (x *CreateProductRequest) String() string
- type CreateProductResponse
- func (*CreateProductResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateProductResponse) GetError() string
- func (x *CreateProductResponse) GetId() int64
- func (x *CreateProductResponse) GetStatus() int64
- func (*CreateProductResponse) ProtoMessage()
- func (x *CreateProductResponse) ProtoReflect() protoreflect.Message
- func (x *CreateProductResponse) Reset()
- func (x *CreateProductResponse) String() string
- type DecreaseStockRequest
- func (*DecreaseStockRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DecreaseStockRequest) GetId() int64
- func (x *DecreaseStockRequest) GetOrderId() int64
- func (*DecreaseStockRequest) ProtoMessage()
- func (x *DecreaseStockRequest) ProtoReflect() protoreflect.Message
- func (x *DecreaseStockRequest) Reset()
- func (x *DecreaseStockRequest) String() string
- type DecreaseStockResponse
- func (*DecreaseStockResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DecreaseStockResponse) GetError() string
- func (x *DecreaseStockResponse) GetStatus() int64
- func (*DecreaseStockResponse) ProtoMessage()
- func (x *DecreaseStockResponse) ProtoReflect() protoreflect.Message
- func (x *DecreaseStockResponse) Reset()
- func (x *DecreaseStockResponse) String() string
- type FindOneData
- func (*FindOneData) Descriptor() ([]byte, []int)deprecated
- func (x *FindOneData) GetId() int64
- func (x *FindOneData) GetName() string
- func (x *FindOneData) GetPrice() int64
- func (x *FindOneData) GetStock() int64
- func (*FindOneData) ProtoMessage()
- func (x *FindOneData) ProtoReflect() protoreflect.Message
- func (x *FindOneData) Reset()
- func (x *FindOneData) String() string
- type FindOneRequest
- type FindOneResponse
- func (*FindOneResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FindOneResponse) GetData() *FindOneData
- func (x *FindOneResponse) GetError() string
- func (x *FindOneResponse) GetStatus() int64
- func (*FindOneResponse) ProtoMessage()
- func (x *FindOneResponse) ProtoReflect() protoreflect.Message
- func (x *FindOneResponse) Reset()
- func (x *FindOneResponse) String() string
- type ProductServiceClient
- type ProductServiceServer
- type UnimplementedProductServiceServer
- func (UnimplementedProductServiceServer) CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
- func (UnimplementedProductServiceServer) DecreaseStock(context.Context, *DecreaseStockRequest) (*DecreaseStockResponse, error)
- func (UnimplementedProductServiceServer) FindOne(context.Context, *FindOneRequest) (*FindOneResponse, error)
- type UnsafeProductServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_pkg_pb_product_proto protoreflect.FileDescriptor
var ProductService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "product.ProductService", HandlerType: (*ProductServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateProduct", Handler: _ProductService_CreateProduct_Handler, }, { MethodName: "FindOne", Handler: _ProductService_FindOne_Handler, }, { MethodName: "DecreaseStock", Handler: _ProductService_DecreaseStock_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/pb/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 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"` Stock int64 `protobuf:"varint,2,opt,name=stock,proto3" json:"stock,omitempty"` Price int64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` // contains filtered or unexported fields }
func (*CreateProductRequest) Descriptor
deprecated
func (*CreateProductRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateProductRequest.ProtoReflect.Descriptor instead.
func (*CreateProductRequest) GetName ¶
func (x *CreateProductRequest) GetName() string
func (*CreateProductRequest) GetPrice ¶
func (x *CreateProductRequest) GetPrice() int64
func (*CreateProductRequest) GetStock ¶
func (x *CreateProductRequest) GetStock() int64
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
type CreateProductResponse ¶
type CreateProductResponse struct { Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateProductResponse) Descriptor
deprecated
func (*CreateProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateProductResponse.ProtoReflect.Descriptor instead.
func (*CreateProductResponse) GetError ¶
func (x *CreateProductResponse) GetError() string
func (*CreateProductResponse) GetId ¶
func (x *CreateProductResponse) GetId() int64
func (*CreateProductResponse) GetStatus ¶
func (x *CreateProductResponse) GetStatus() int64
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
type DecreaseStockRequest ¶
type DecreaseStockRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` OrderId int64 `protobuf:"varint,2,opt,name=orderId,proto3" json:"orderId,omitempty"` // contains filtered or unexported fields }
func (*DecreaseStockRequest) Descriptor
deprecated
func (*DecreaseStockRequest) Descriptor() ([]byte, []int)
Deprecated: Use DecreaseStockRequest.ProtoReflect.Descriptor instead.
func (*DecreaseStockRequest) GetId ¶
func (x *DecreaseStockRequest) GetId() int64
func (*DecreaseStockRequest) GetOrderId ¶
func (x *DecreaseStockRequest) GetOrderId() int64
func (*DecreaseStockRequest) ProtoMessage ¶
func (*DecreaseStockRequest) ProtoMessage()
func (*DecreaseStockRequest) ProtoReflect ¶
func (x *DecreaseStockRequest) ProtoReflect() protoreflect.Message
func (*DecreaseStockRequest) Reset ¶
func (x *DecreaseStockRequest) Reset()
func (*DecreaseStockRequest) String ¶
func (x *DecreaseStockRequest) String() string
type DecreaseStockResponse ¶
type DecreaseStockResponse struct { Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*DecreaseStockResponse) Descriptor
deprecated
func (*DecreaseStockResponse) Descriptor() ([]byte, []int)
Deprecated: Use DecreaseStockResponse.ProtoReflect.Descriptor instead.
func (*DecreaseStockResponse) GetError ¶
func (x *DecreaseStockResponse) GetError() string
func (*DecreaseStockResponse) GetStatus ¶
func (x *DecreaseStockResponse) GetStatus() int64
func (*DecreaseStockResponse) ProtoMessage ¶
func (*DecreaseStockResponse) ProtoMessage()
func (*DecreaseStockResponse) ProtoReflect ¶
func (x *DecreaseStockResponse) ProtoReflect() protoreflect.Message
func (*DecreaseStockResponse) Reset ¶
func (x *DecreaseStockResponse) Reset()
func (*DecreaseStockResponse) String ¶
func (x *DecreaseStockResponse) String() string
type FindOneData ¶
type FindOneData struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Stock int64 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` Price int64 `protobuf:"varint,4,opt,name=price,proto3" json:"price,omitempty"` // contains filtered or unexported fields }
func (*FindOneData) Descriptor
deprecated
func (*FindOneData) Descriptor() ([]byte, []int)
Deprecated: Use FindOneData.ProtoReflect.Descriptor instead.
func (*FindOneData) GetId ¶
func (x *FindOneData) GetId() int64
func (*FindOneData) GetName ¶
func (x *FindOneData) GetName() string
func (*FindOneData) GetPrice ¶
func (x *FindOneData) GetPrice() int64
func (*FindOneData) GetStock ¶
func (x *FindOneData) GetStock() int64
func (*FindOneData) ProtoMessage ¶
func (*FindOneData) ProtoMessage()
func (*FindOneData) ProtoReflect ¶
func (x *FindOneData) ProtoReflect() protoreflect.Message
func (*FindOneData) Reset ¶
func (x *FindOneData) Reset()
func (*FindOneData) String ¶
func (x *FindOneData) String() string
type FindOneRequest ¶
type FindOneRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*FindOneRequest) Descriptor
deprecated
func (*FindOneRequest) Descriptor() ([]byte, []int)
Deprecated: Use FindOneRequest.ProtoReflect.Descriptor instead.
func (*FindOneRequest) GetId ¶
func (x *FindOneRequest) GetId() int64
func (*FindOneRequest) ProtoMessage ¶
func (*FindOneRequest) ProtoMessage()
func (*FindOneRequest) ProtoReflect ¶
func (x *FindOneRequest) ProtoReflect() protoreflect.Message
func (*FindOneRequest) Reset ¶
func (x *FindOneRequest) Reset()
func (*FindOneRequest) String ¶
func (x *FindOneRequest) String() string
type FindOneResponse ¶
type FindOneResponse struct { Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Data *FindOneData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*FindOneResponse) Descriptor
deprecated
func (*FindOneResponse) Descriptor() ([]byte, []int)
Deprecated: Use FindOneResponse.ProtoReflect.Descriptor instead.
func (*FindOneResponse) GetData ¶
func (x *FindOneResponse) GetData() *FindOneData
func (*FindOneResponse) GetError ¶
func (x *FindOneResponse) GetError() string
func (*FindOneResponse) GetStatus ¶
func (x *FindOneResponse) GetStatus() int64
func (*FindOneResponse) ProtoMessage ¶
func (*FindOneResponse) ProtoMessage()
func (*FindOneResponse) ProtoReflect ¶
func (x *FindOneResponse) ProtoReflect() protoreflect.Message
func (*FindOneResponse) Reset ¶
func (x *FindOneResponse) Reset()
func (*FindOneResponse) String ¶
func (x *FindOneResponse) String() string
type ProductServiceClient ¶
type ProductServiceClient interface { CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...grpc.CallOption) (*CreateProductResponse, error) FindOne(ctx context.Context, in *FindOneRequest, opts ...grpc.CallOption) (*FindOneResponse, error) DecreaseStock(ctx context.Context, in *DecreaseStockRequest, opts ...grpc.CallOption) (*DecreaseStockResponse, 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.
func NewProductServiceClient ¶
func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient
type ProductServiceServer ¶
type ProductServiceServer interface { CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error) FindOne(context.Context, *FindOneRequest) (*FindOneResponse, error) DecreaseStock(context.Context, *DecreaseStockRequest) (*DecreaseStockResponse, error) }
ProductServiceServer is the server API for ProductService service. All implementations should embed UnimplementedProductServiceServer for forward compatibility
type UnimplementedProductServiceServer ¶
type UnimplementedProductServiceServer struct { }
UnimplementedProductServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedProductServiceServer) CreateProduct ¶
func (UnimplementedProductServiceServer) CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
func (UnimplementedProductServiceServer) DecreaseStock ¶
func (UnimplementedProductServiceServer) DecreaseStock(context.Context, *DecreaseStockRequest) (*DecreaseStockResponse, error)
func (UnimplementedProductServiceServer) FindOne ¶
func (UnimplementedProductServiceServer) FindOne(context.Context, *FindOneRequest) (*FindOneResponse, 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.