2025-03-12 14:05:38 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.19.4
// source: generate/protobuf/product.proto
package product
import (
2025-04-08 00:51:58 +00:00
context "context"
2025-03-12 14:05:38 +00:00
grpc "google.golang.org/grpc"
2025-04-08 00:51:58 +00:00
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
2025-03-12 14:05:38 +00:00
)
// 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.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
2025-04-08 00:51:58 +00:00
const (
Product_CreateCategory_FullMethodName = "/product.Product/CreateCategory"
)
2025-03-12 14:05:38 +00:00
// ProductClient is the client API for Product 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 ProductClient interface {
2025-04-08 00:51:58 +00:00
// CreateCategory 建立 product 分類
CreateCategory ( ctx context . Context , in * CreateCategoryReq , opts ... grpc . CallOption ) ( * OKResp , error )
2025-03-12 14:05:38 +00:00
}
type productClient struct {
cc grpc . ClientConnInterface
}
func NewProductClient ( cc grpc . ClientConnInterface ) ProductClient {
return & productClient { cc }
}
2025-04-08 00:51:58 +00:00
func ( c * productClient ) CreateCategory ( ctx context . Context , in * CreateCategoryReq , opts ... grpc . CallOption ) ( * OKResp , error ) {
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
out := new ( OKResp )
err := c . cc . Invoke ( ctx , Product_CreateCategory_FullMethodName , in , out , cOpts ... )
if err != nil {
return nil , err
}
return out , nil
}
2025-03-12 14:05:38 +00:00
// ProductServer is the server API for Product service.
// All implementations must embed UnimplementedProductServer
// for forward compatibility.
type ProductServer interface {
2025-04-08 00:51:58 +00:00
// CreateCategory 建立 product 分類
CreateCategory ( context . Context , * CreateCategoryReq ) ( * OKResp , error )
2025-03-12 14:05:38 +00:00
mustEmbedUnimplementedProductServer ( )
}
// UnimplementedProductServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedProductServer struct { }
2025-04-08 00:51:58 +00:00
func ( UnimplementedProductServer ) CreateCategory ( context . Context , * CreateCategoryReq ) ( * OKResp , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method CreateCategory not implemented" )
}
2025-03-12 14:05:38 +00:00
func ( UnimplementedProductServer ) mustEmbedUnimplementedProductServer ( ) { }
func ( UnimplementedProductServer ) testEmbeddedByValue ( ) { }
// UnsafeProductServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ProductServer will
// result in compilation errors.
type UnsafeProductServer interface {
mustEmbedUnimplementedProductServer ( )
}
func RegisterProductServer ( s grpc . ServiceRegistrar , srv ProductServer ) {
// If the following call pancis, it indicates UnimplementedProductServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t , ok := srv . ( interface { testEmbeddedByValue ( ) } ) ; ok {
t . testEmbeddedByValue ( )
}
s . RegisterService ( & Product_ServiceDesc , srv )
}
2025-04-08 00:51:58 +00:00
func _Product_CreateCategory_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CreateCategoryReq )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ProductServer ) . CreateCategory ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : Product_CreateCategory_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ProductServer ) . CreateCategory ( ctx , req . ( * CreateCategoryReq ) )
}
return interceptor ( ctx , in , info , handler )
}
2025-03-12 14:05:38 +00:00
// Product_ServiceDesc is the grpc.ServiceDesc for Product service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Product_ServiceDesc = grpc . ServiceDesc {
ServiceName : "product.Product" ,
HandlerType : ( * ProductServer ) ( nil ) ,
2025-04-08 00:51:58 +00:00
Methods : [ ] grpc . MethodDesc {
{
MethodName : "CreateCategory" ,
Handler : _Product_CreateCategory_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "generate/protobuf/product.proto" ,
2025-03-12 14:05:38 +00:00
}