mirror of
https://github.com/hexolan/stocklet.git
synced 2026-03-26 11:41:18 +00:00
255 lines
10 KiB
Go
255 lines
10 KiB
Go
// Copyright (C) 2024 Declan Teevan
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc (unknown)
|
|
// source: stocklet/product/v1/service.proto
|
|
|
|
package product_v1
|
|
|
|
import (
|
|
context "context"
|
|
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
|
|
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.32.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
const (
|
|
ProductService_ServiceInfo_FullMethodName = "/stocklet.product.v1.ProductService/ServiceInfo"
|
|
ProductService_ViewProduct_FullMethodName = "/stocklet.product.v1.ProductService/ViewProduct"
|
|
ProductService_ViewProducts_FullMethodName = "/stocklet.product.v1.ProductService/ViewProducts"
|
|
ProductService_ProcessOrderCreatedEvent_FullMethodName = "/stocklet.product.v1.ProductService/ProcessOrderCreatedEvent"
|
|
)
|
|
|
|
// 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.
|
|
type ProductServiceClient interface {
|
|
// View information about the service.
|
|
//
|
|
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
|
|
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
|
|
ViewProduct(ctx context.Context, in *ViewProductRequest, opts ...grpc.CallOption) (*ViewProductResponse, error)
|
|
ViewProducts(ctx context.Context, in *ViewProductsRequest, opts ...grpc.CallOption) (*ViewProductsResponse, error)
|
|
// A consumer will call this method to process events.
|
|
//
|
|
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
|
|
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
|
|
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
|
|
ProcessOrderCreatedEvent(ctx context.Context, in *v11.OrderCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
}
|
|
|
|
type productServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient {
|
|
return &productServiceClient{cc}
|
|
}
|
|
|
|
func (c *productServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
|
|
out := new(v1.ServiceInfoResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_ServiceInfo_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productServiceClient) ViewProduct(ctx context.Context, in *ViewProductRequest, opts ...grpc.CallOption) (*ViewProductResponse, error) {
|
|
out := new(ViewProductResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_ViewProduct_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productServiceClient) ViewProducts(ctx context.Context, in *ViewProductsRequest, opts ...grpc.CallOption) (*ViewProductsResponse, error) {
|
|
out := new(ViewProductsResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_ViewProducts_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productServiceClient) ProcessOrderCreatedEvent(ctx context.Context, in *v11.OrderCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, ProductService_ProcessOrderCreatedEvent_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ProductServiceServer is the server API for ProductService service.
|
|
// All implementations must embed UnimplementedProductServiceServer
|
|
// for forward compatibility
|
|
type ProductServiceServer interface {
|
|
// View information about the service.
|
|
//
|
|
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
|
|
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
|
|
ViewProduct(context.Context, *ViewProductRequest) (*ViewProductResponse, error)
|
|
ViewProducts(context.Context, *ViewProductsRequest) (*ViewProductsResponse, error)
|
|
// A consumer will call this method to process events.
|
|
//
|
|
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
|
|
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
|
|
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
|
|
ProcessOrderCreatedEvent(context.Context, *v11.OrderCreatedEvent) (*emptypb.Empty, error)
|
|
mustEmbedUnimplementedProductServiceServer()
|
|
}
|
|
|
|
// UnimplementedProductServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedProductServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedProductServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) ViewProduct(context.Context, *ViewProductRequest) (*ViewProductResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ViewProduct not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) ViewProducts(context.Context, *ViewProductsRequest) (*ViewProductsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ViewProducts not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) ProcessOrderCreatedEvent(context.Context, *v11.OrderCreatedEvent) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ProcessOrderCreatedEvent not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) mustEmbedUnimplementedProductServiceServer() {}
|
|
|
|
// 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 UnsafeProductServiceServer interface {
|
|
mustEmbedUnimplementedProductServiceServer()
|
|
}
|
|
|
|
func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer) {
|
|
s.RegisterService(&ProductService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _ProductService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(v1.ServiceInfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).ServiceInfo(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_ServiceInfo_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ProductService_ViewProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ViewProductRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).ViewProduct(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_ViewProduct_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).ViewProduct(ctx, req.(*ViewProductRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ProductService_ViewProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ViewProductsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).ViewProducts(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_ViewProducts_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).ViewProducts(ctx, req.(*ViewProductsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ProductService_ProcessOrderCreatedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(v11.OrderCreatedEvent)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).ProcessOrderCreatedEvent(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_ProcessOrderCreatedEvent_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).ProcessOrderCreatedEvent(ctx, req.(*v11.OrderCreatedEvent))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// 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)
|
|
var ProductService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "stocklet.product.v1.ProductService",
|
|
HandlerType: (*ProductServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ServiceInfo",
|
|
Handler: _ProductService_ServiceInfo_Handler,
|
|
},
|
|
{
|
|
MethodName: "ViewProduct",
|
|
Handler: _ProductService_ViewProduct_Handler,
|
|
},
|
|
{
|
|
MethodName: "ViewProducts",
|
|
Handler: _ProductService_ViewProducts_Handler,
|
|
},
|
|
{
|
|
MethodName: "ProcessOrderCreatedEvent",
|
|
Handler: _ProductService_ProcessOrderCreatedEvent_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "stocklet/product/v1/service.proto",
|
|
}
|