2024-10-20 16:05:40 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.28.2
2024-10-21 14:15:45 +00:00
// source: authenticate.proto
2024-10-20 16:05:40 +00:00
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.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
const (
2024-10-21 14:07:36 +00:00
AuthService_Authenticate_FullMethodName = "/proto.AuthService/Authenticate"
AuthService_EnsurePermGranted_FullMethodName = "/proto.AuthService/EnsurePermGranted"
AuthService_EnsureUserPermGranted_FullMethodName = "/proto.AuthService/EnsureUserPermGranted"
AuthService_ListUserRelative_FullMethodName = "/proto.AuthService/ListUserRelative"
2024-10-20 16:05:40 +00:00
)
2024-10-21 14:07:36 +00:00
// AuthServiceClient is the client API for AuthService service.
2024-10-20 16:05:40 +00:00
//
// 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.
2024-10-21 14:07:36 +00:00
type AuthServiceClient interface {
2024-10-20 16:05:40 +00:00
Authenticate ( ctx context . Context , in * AuthRequest , opts ... grpc . CallOption ) ( * AuthReply , error )
EnsurePermGranted ( ctx context . Context , in * CheckPermRequest , opts ... grpc . CallOption ) ( * CheckPermResponse , error )
EnsureUserPermGranted ( ctx context . Context , in * CheckUserPermRequest , opts ... grpc . CallOption ) ( * CheckUserPermResponse , error )
ListUserRelative ( ctx context . Context , in * ListUserRelativeRequest , opts ... grpc . CallOption ) ( * ListUserRelativeResponse , error )
}
2024-10-21 14:07:36 +00:00
type authServiceClient struct {
2024-10-20 16:05:40 +00:00
cc grpc . ClientConnInterface
}
2024-10-21 14:07:36 +00:00
func NewAuthServiceClient ( cc grpc . ClientConnInterface ) AuthServiceClient {
return & authServiceClient { cc }
2024-10-20 16:05:40 +00:00
}
2024-10-21 14:07:36 +00:00
func ( c * authServiceClient ) Authenticate ( ctx context . Context , in * AuthRequest , opts ... grpc . CallOption ) ( * AuthReply , error ) {
2024-10-20 16:05:40 +00:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
out := new ( AuthReply )
2024-10-21 14:07:36 +00:00
err := c . cc . Invoke ( ctx , AuthService_Authenticate_FullMethodName , in , out , cOpts ... )
2024-10-20 16:05:40 +00:00
if err != nil {
return nil , err
}
return out , nil
}
2024-10-21 14:07:36 +00:00
func ( c * authServiceClient ) EnsurePermGranted ( ctx context . Context , in * CheckPermRequest , opts ... grpc . CallOption ) ( * CheckPermResponse , error ) {
2024-10-20 16:05:40 +00:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
out := new ( CheckPermResponse )
2024-10-21 14:07:36 +00:00
err := c . cc . Invoke ( ctx , AuthService_EnsurePermGranted_FullMethodName , in , out , cOpts ... )
2024-10-20 16:05:40 +00:00
if err != nil {
return nil , err
}
return out , nil
}
2024-10-21 14:07:36 +00:00
func ( c * authServiceClient ) EnsureUserPermGranted ( ctx context . Context , in * CheckUserPermRequest , opts ... grpc . CallOption ) ( * CheckUserPermResponse , error ) {
2024-10-20 16:05:40 +00:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
out := new ( CheckUserPermResponse )
2024-10-21 14:07:36 +00:00
err := c . cc . Invoke ( ctx , AuthService_EnsureUserPermGranted_FullMethodName , in , out , cOpts ... )
2024-10-20 16:05:40 +00:00
if err != nil {
return nil , err
}
return out , nil
}
2024-10-21 14:07:36 +00:00
func ( c * authServiceClient ) ListUserRelative ( ctx context . Context , in * ListUserRelativeRequest , opts ... grpc . CallOption ) ( * ListUserRelativeResponse , error ) {
2024-10-20 16:05:40 +00:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
out := new ( ListUserRelativeResponse )
2024-10-21 14:07:36 +00:00
err := c . cc . Invoke ( ctx , AuthService_ListUserRelative_FullMethodName , in , out , cOpts ... )
2024-10-20 16:05:40 +00:00
if err != nil {
return nil , err
}
return out , nil
}
2024-10-21 14:07:36 +00:00
// AuthServiceServer is the server API for AuthService service.
// All implementations must embed UnimplementedAuthServiceServer
2024-10-20 16:05:40 +00:00
// for forward compatibility.
2024-10-21 14:07:36 +00:00
type AuthServiceServer interface {
2024-10-20 16:05:40 +00:00
Authenticate ( context . Context , * AuthRequest ) ( * AuthReply , error )
EnsurePermGranted ( context . Context , * CheckPermRequest ) ( * CheckPermResponse , error )
EnsureUserPermGranted ( context . Context , * CheckUserPermRequest ) ( * CheckUserPermResponse , error )
ListUserRelative ( context . Context , * ListUserRelativeRequest ) ( * ListUserRelativeResponse , error )
2024-10-21 14:07:36 +00:00
mustEmbedUnimplementedAuthServiceServer ( )
2024-10-20 16:05:40 +00:00
}
2024-10-21 14:07:36 +00:00
// UnimplementedAuthServiceServer must be embedded to have
2024-10-20 16:05:40 +00:00
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
2024-10-21 14:07:36 +00:00
type UnimplementedAuthServiceServer struct { }
2024-10-20 16:05:40 +00:00
2024-10-21 14:07:36 +00:00
func ( UnimplementedAuthServiceServer ) Authenticate ( context . Context , * AuthRequest ) ( * AuthReply , error ) {
2024-10-20 16:05:40 +00:00
return nil , status . Errorf ( codes . Unimplemented , "method Authenticate not implemented" )
}
2024-10-21 14:07:36 +00:00
func ( UnimplementedAuthServiceServer ) EnsurePermGranted ( context . Context , * CheckPermRequest ) ( * CheckPermResponse , error ) {
2024-10-20 16:05:40 +00:00
return nil , status . Errorf ( codes . Unimplemented , "method EnsurePermGranted not implemented" )
}
2024-10-21 14:07:36 +00:00
func ( UnimplementedAuthServiceServer ) EnsureUserPermGranted ( context . Context , * CheckUserPermRequest ) ( * CheckUserPermResponse , error ) {
2024-10-20 16:05:40 +00:00
return nil , status . Errorf ( codes . Unimplemented , "method EnsureUserPermGranted not implemented" )
}
2024-10-21 14:07:36 +00:00
func ( UnimplementedAuthServiceServer ) ListUserRelative ( context . Context , * ListUserRelativeRequest ) ( * ListUserRelativeResponse , error ) {
2024-10-20 16:05:40 +00:00
return nil , status . Errorf ( codes . Unimplemented , "method ListUserRelative not implemented" )
}
2024-10-21 14:07:36 +00:00
func ( UnimplementedAuthServiceServer ) mustEmbedUnimplementedAuthServiceServer ( ) { }
func ( UnimplementedAuthServiceServer ) testEmbeddedByValue ( ) { }
2024-10-20 16:05:40 +00:00
2024-10-21 14:07:36 +00:00
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthServiceServer will
2024-10-20 16:05:40 +00:00
// result in compilation errors.
2024-10-21 14:07:36 +00:00
type UnsafeAuthServiceServer interface {
mustEmbedUnimplementedAuthServiceServer ( )
2024-10-20 16:05:40 +00:00
}
2024-10-21 14:07:36 +00:00
func RegisterAuthServiceServer ( s grpc . ServiceRegistrar , srv AuthServiceServer ) {
// If the following call pancis, it indicates UnimplementedAuthServiceServer was
2024-10-20 16:05:40 +00:00
// 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 ( )
}
2024-10-21 14:07:36 +00:00
s . RegisterService ( & AuthService_ServiceDesc , srv )
2024-10-20 16:05:40 +00:00
}
2024-10-21 14:07:36 +00:00
func _AuthService_Authenticate_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2024-10-20 16:05:40 +00:00
in := new ( AuthRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . Authenticate ( ctx , in )
2024-10-20 16:05:40 +00:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-10-21 14:07:36 +00:00
FullMethod : AuthService_Authenticate_FullMethodName ,
2024-10-20 16:05:40 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . Authenticate ( ctx , req . ( * AuthRequest ) )
2024-10-20 16:05:40 +00:00
}
return interceptor ( ctx , in , info , handler )
}
2024-10-21 14:07:36 +00:00
func _AuthService_EnsurePermGranted_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2024-10-20 16:05:40 +00:00
in := new ( CheckPermRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . EnsurePermGranted ( ctx , in )
2024-10-20 16:05:40 +00:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-10-21 14:07:36 +00:00
FullMethod : AuthService_EnsurePermGranted_FullMethodName ,
2024-10-20 16:05:40 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . EnsurePermGranted ( ctx , req . ( * CheckPermRequest ) )
2024-10-20 16:05:40 +00:00
}
return interceptor ( ctx , in , info , handler )
}
2024-10-21 14:07:36 +00:00
func _AuthService_EnsureUserPermGranted_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2024-10-20 16:05:40 +00:00
in := new ( CheckUserPermRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . EnsureUserPermGranted ( ctx , in )
2024-10-20 16:05:40 +00:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-10-21 14:07:36 +00:00
FullMethod : AuthService_EnsureUserPermGranted_FullMethodName ,
2024-10-20 16:05:40 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . EnsureUserPermGranted ( ctx , req . ( * CheckUserPermRequest ) )
2024-10-20 16:05:40 +00:00
}
return interceptor ( ctx , in , info , handler )
}
2024-10-21 14:07:36 +00:00
func _AuthService_ListUserRelative_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2024-10-20 16:05:40 +00:00
in := new ( ListUserRelativeRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . ListUserRelative ( ctx , in )
2024-10-20 16:05:40 +00:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-10-21 14:07:36 +00:00
FullMethod : AuthService_ListUserRelative_FullMethodName ,
2024-10-20 16:05:40 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2024-10-21 14:07:36 +00:00
return srv . ( AuthServiceServer ) . ListUserRelative ( ctx , req . ( * ListUserRelativeRequest ) )
2024-10-20 16:05:40 +00:00
}
return interceptor ( ctx , in , info , handler )
}
2024-10-21 14:07:36 +00:00
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
2024-10-20 16:05:40 +00:00
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
2024-10-21 14:07:36 +00:00
var AuthService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "proto.AuthService" ,
HandlerType : ( * AuthServiceServer ) ( nil ) ,
2024-10-20 16:05:40 +00:00
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Authenticate" ,
2024-10-21 14:07:36 +00:00
Handler : _AuthService_Authenticate_Handler ,
2024-10-20 16:05:40 +00:00
} ,
{
MethodName : "EnsurePermGranted" ,
2024-10-21 14:07:36 +00:00
Handler : _AuthService_EnsurePermGranted_Handler ,
2024-10-20 16:05:40 +00:00
} ,
{
MethodName : "EnsureUserPermGranted" ,
2024-10-21 14:07:36 +00:00
Handler : _AuthService_EnsureUserPermGranted_Handler ,
2024-10-20 16:05:40 +00:00
} ,
{
MethodName : "ListUserRelative" ,
2024-10-21 14:07:36 +00:00
Handler : _AuthService_ListUserRelative_Handler ,
2024-10-20 16:05:40 +00:00
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
2024-10-21 14:15:45 +00:00
Metadata : "authenticate.proto" ,
2024-10-20 16:05:40 +00:00
}