268 lines
9.6 KiB
Go
268 lines
9.6 KiB
Go
// Copyright (C) 2023 The Licensing Authors
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//
|
|
// This file attempts to follow common styles and design patterns described by
|
|
// Google Cloud based on their extensive use of protocol buffers.
|
|
//
|
|
// - See here for more: https://cloud.google.com/apis/design/design_patterns
|
|
//
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc (unknown)
|
|
// source: products/v1/service.proto
|
|
|
|
package productsv1
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// 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_List_FullMethodName = "/products.v1.ProductService/List"
|
|
ProductService_Create_FullMethodName = "/products.v1.ProductService/Create"
|
|
ProductService_Read_FullMethodName = "/products.v1.ProductService/Read"
|
|
ProductService_Update_FullMethodName = "/products.v1.ProductService/Update"
|
|
ProductService_Delete_FullMethodName = "/products.v1.ProductService/Delete"
|
|
)
|
|
|
|
// 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 {
|
|
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
|
|
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
|
|
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
|
|
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
|
|
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
|
}
|
|
|
|
type productServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient {
|
|
return &productServiceClient{cc}
|
|
}
|
|
|
|
func (c *productServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
|
|
out := new(ListResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_List_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
|
|
out := new(CreateResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_Create_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productServiceClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) {
|
|
out := new(ReadResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_Read_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productServiceClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) {
|
|
out := new(UpdateResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_Update_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
|
|
out := new(DeleteResponse)
|
|
err := c.cc.Invoke(ctx, ProductService_Delete_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 {
|
|
List(context.Context, *ListRequest) (*ListResponse, error)
|
|
Create(context.Context, *CreateRequest) (*CreateResponse, error)
|
|
Read(context.Context, *ReadRequest) (*ReadResponse, error)
|
|
Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
|
|
Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
|
|
mustEmbedUnimplementedProductServiceServer()
|
|
}
|
|
|
|
// UnimplementedProductServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedProductServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedProductServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) Read(context.Context, *ReadRequest) (*ReadResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Read not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
|
}
|
|
func (UnimplementedProductServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Delete 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_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).List(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_List_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).List(ctx, req.(*ListRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ProductService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).Create(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_Create_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).Create(ctx, req.(*CreateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ProductService_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ReadRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).Read(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_Read_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).Read(ctx, req.(*ReadRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ProductService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).Update(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_Update_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).Update(ctx, req.(*UpdateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ProductService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServiceServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ProductService_Delete_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServiceServer).Delete(ctx, req.(*DeleteRequest))
|
|
}
|
|
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: "products.v1.ProductService",
|
|
HandlerType: (*ProductServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "List",
|
|
Handler: _ProductService_List_Handler,
|
|
},
|
|
{
|
|
MethodName: "Create",
|
|
Handler: _ProductService_Create_Handler,
|
|
},
|
|
{
|
|
MethodName: "Read",
|
|
Handler: _ProductService_Read_Handler,
|
|
},
|
|
{
|
|
MethodName: "Update",
|
|
Handler: _ProductService_Update_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _ProductService_Delete_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "products/v1/service.proto",
|
|
}
|