2024-10-20 16:05:40 +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-20 16:05:40 +00:00
// - 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.
2024-11-02 17:40:36 +00:00
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
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 )
}
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
out := new ( AuthReply )
2024-11-02 17:40:36 +00:00
err := c . cc . Invoke ( ctx , "/proto.AuthService/Authenticate" , in , out , opts ... )
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
out := new ( CheckPermResponse )
2024-11-02 17:40:36 +00:00
err := c . cc . Invoke ( ctx , "/proto.AuthService/EnsurePermGranted" , in , out , opts ... )
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
out := new ( CheckUserPermResponse )
2024-11-02 17:40:36 +00:00
err := c . cc . Invoke ( ctx , "/proto.AuthService/EnsureUserPermGranted" , in , out , opts ... )
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-11-02 17:40:36 +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 )
2024-10-21 14:07:36 +00:00
mustEmbedUnimplementedAuthServiceServer ( )
2024-10-20 16:05:40 +00:00
}
2024-11-02 17:40:36 +00:00
// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
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 ) mustEmbedUnimplementedAuthServiceServer ( ) { }
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 ) {
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-11-02 17:40:36 +00:00
FullMethod : "/proto.AuthService/Authenticate" ,
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-11-02 17:40:36 +00:00
FullMethod : "/proto.AuthService/EnsurePermGranted" ,
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-11-02 17:40:36 +00:00
FullMethod : "/proto.AuthService/EnsureUserPermGranted" ,
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
// 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
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
2024-10-21 14:15:45 +00:00
Metadata : "authenticate.proto" ,
2024-10-20 16:05:40 +00:00
}