2024-10-31 12:57:27 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2024-11-02 17:40:36 +00:00
// - protoc-gen-go-grpc v1.2.0
2024-10-31 12:57:27 +00:00
// - protoc v5.28.2
// source: user.proto
package proto
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.
2024-11-02 17:40:36 +00:00
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
2024-10-31 12:57:27 +00:00
// UserServiceClient is the client API for UserService 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 UserServiceClient interface {
GetUser ( ctx context . Context , in * GetUserRequest , opts ... grpc . CallOption ) ( * UserInfo , error )
ListUser ( ctx context . Context , in * ListUserRequest , opts ... grpc . CallOption ) ( * MultipleUserInfo , error )
ListUserRelative ( ctx context . Context , in * ListUserRelativeRequest , opts ... grpc . CallOption ) ( * ListUserRelativeResponse , error )
}
type userServiceClient struct {
cc grpc . ClientConnInterface
}
func NewUserServiceClient ( cc grpc . ClientConnInterface ) UserServiceClient {
return & userServiceClient { cc }
}
func ( c * userServiceClient ) GetUser ( ctx context . Context , in * GetUserRequest , opts ... grpc . CallOption ) ( * UserInfo , error ) {
out := new ( UserInfo )
2024-11-02 17:40:36 +00:00
err := c . cc . Invoke ( ctx , "/proto.UserService/GetUser" , in , out , opts ... )
2024-10-31 12:57:27 +00:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * userServiceClient ) ListUser ( ctx context . Context , in * ListUserRequest , opts ... grpc . CallOption ) ( * MultipleUserInfo , error ) {
out := new ( MultipleUserInfo )
2024-11-02 17:40:36 +00:00
err := c . cc . Invoke ( ctx , "/proto.UserService/ListUser" , in , out , opts ... )
2024-10-31 12:57:27 +00:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * userServiceClient ) ListUserRelative ( ctx context . Context , in * ListUserRelativeRequest , opts ... grpc . CallOption ) ( * ListUserRelativeResponse , error ) {
out := new ( ListUserRelativeResponse )
2024-11-02 17:40:36 +00:00
err := c . cc . Invoke ( ctx , "/proto.UserService/ListUserRelative" , in , out , opts ... )
2024-10-31 12:57:27 +00:00
if err != nil {
return nil , err
}
return out , nil
}
// UserServiceServer is the server API for UserService service.
// All implementations must embed UnimplementedUserServiceServer
2024-11-02 17:40:36 +00:00
// for forward compatibility
2024-10-31 12:57:27 +00:00
type UserServiceServer interface {
GetUser ( context . Context , * GetUserRequest ) ( * UserInfo , error )
ListUser ( context . Context , * ListUserRequest ) ( * MultipleUserInfo , error )
ListUserRelative ( context . Context , * ListUserRelativeRequest ) ( * ListUserRelativeResponse , error )
mustEmbedUnimplementedUserServiceServer ( )
}
2024-11-02 17:40:36 +00:00
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
type UnimplementedUserServiceServer struct {
}
2024-10-31 12:57:27 +00:00
func ( UnimplementedUserServiceServer ) GetUser ( context . Context , * GetUserRequest ) ( * UserInfo , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetUser not implemented" )
}
func ( UnimplementedUserServiceServer ) ListUser ( context . Context , * ListUserRequest ) ( * MultipleUserInfo , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ListUser not implemented" )
}
func ( UnimplementedUserServiceServer ) ListUserRelative ( context . Context , * ListUserRelativeRequest ) ( * ListUserRelativeResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ListUserRelative not implemented" )
}
func ( UnimplementedUserServiceServer ) mustEmbedUnimplementedUserServiceServer ( ) { }
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServiceServer will
// result in compilation errors.
type UnsafeUserServiceServer interface {
mustEmbedUnimplementedUserServiceServer ( )
}
func RegisterUserServiceServer ( s grpc . ServiceRegistrar , srv UserServiceServer ) {
s . RegisterService ( & UserService_ServiceDesc , srv )
}
func _UserService_GetUser_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetUserRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . GetUser ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-11-02 17:40:36 +00:00
FullMethod : "/proto.UserService/GetUser" ,
2024-10-31 12:57:27 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . GetUser ( ctx , req . ( * GetUserRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _UserService_ListUser_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ListUserRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . ListUser ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-11-02 17:40:36 +00:00
FullMethod : "/proto.UserService/ListUser" ,
2024-10-31 12:57:27 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . ListUser ( ctx , req . ( * ListUserRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _UserService_ListUserRelative_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ListUserRelativeRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . ListUserRelative ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-11-02 17:40:36 +00:00
FullMethod : "/proto.UserService/ListUserRelative" ,
2024-10-31 12:57:27 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . ListUserRelative ( ctx , req . ( * ListUserRelativeRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "proto.UserService" ,
HandlerType : ( * UserServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "GetUser" ,
Handler : _UserService_GetUser_Handler ,
} ,
{
MethodName : "ListUser" ,
Handler : _UserService_ListUser_Handler ,
} ,
{
MethodName : "ListUserRelative" ,
Handler : _UserService_ListUserRelative_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "user.proto" ,
}