2024-10-07 14:20:25 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2024-12-26 07:03:55 +00:00
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
2024-10-07 14:20:25 +00:00
// source: api/session/grpc/service.proto
package session
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-12-26 07:03:55 +00:00
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
2024-10-07 14:20:25 +00:00
const (
SessionService_Create_FullMethodName = "/neo.fs.v2.session.SessionService/Create"
)
// SessionServiceClient is the client API for SessionService 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.
2024-12-26 07:03:55 +00:00
//
// `SessionService` allows to establish a temporary trust relationship between
// two peer nodes and generate a `SessionToken` as the proof of trust to be
// attached in requests for further verification. Please see corresponding
// section of FrostFS Technical Specification for details.
2024-10-07 14:20:25 +00:00
type SessionServiceClient interface {
// Open a new session between two peers.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// session has been successfully opened;
// - Common failures (SECTION_FAILURE_COMMON).
Create ( ctx context . Context , in * CreateRequest , opts ... grpc . CallOption ) ( * CreateResponse , error )
}
type sessionServiceClient struct {
cc grpc . ClientConnInterface
}
func NewSessionServiceClient ( cc grpc . ClientConnInterface ) SessionServiceClient {
return & sessionServiceClient { cc }
}
func ( c * sessionServiceClient ) Create ( ctx context . Context , in * CreateRequest , opts ... grpc . CallOption ) ( * CreateResponse , error ) {
2024-12-26 07:03:55 +00:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-10-07 14:20:25 +00:00
out := new ( CreateResponse )
2024-12-26 07:03:55 +00:00
err := c . cc . Invoke ( ctx , SessionService_Create_FullMethodName , in , out , cOpts ... )
2024-10-07 14:20:25 +00:00
if err != nil {
return nil , err
}
return out , nil
}
// SessionServiceServer is the server API for SessionService service.
// All implementations should embed UnimplementedSessionServiceServer
2024-12-26 07:03:55 +00:00
// for forward compatibility.
//
// `SessionService` allows to establish a temporary trust relationship between
// two peer nodes and generate a `SessionToken` as the proof of trust to be
// attached in requests for further verification. Please see corresponding
// section of FrostFS Technical Specification for details.
2024-10-07 14:20:25 +00:00
type SessionServiceServer interface {
// Open a new session between two peers.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// session has been successfully opened;
// - Common failures (SECTION_FAILURE_COMMON).
Create ( context . Context , * CreateRequest ) ( * CreateResponse , error )
}
2024-12-26 07:03:55 +00:00
// UnimplementedSessionServiceServer should 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 UnimplementedSessionServiceServer struct { }
2024-10-07 14:20:25 +00:00
func ( UnimplementedSessionServiceServer ) Create ( context . Context , * CreateRequest ) ( * CreateResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Create not implemented" )
}
2024-12-26 07:03:55 +00:00
func ( UnimplementedSessionServiceServer ) testEmbeddedByValue ( ) { }
2024-10-07 14:20:25 +00:00
// UnsafeSessionServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SessionServiceServer will
// result in compilation errors.
type UnsafeSessionServiceServer interface {
mustEmbedUnimplementedSessionServiceServer ( )
}
func RegisterSessionServiceServer ( s grpc . ServiceRegistrar , srv SessionServiceServer ) {
2024-12-26 07:03:55 +00:00
// If the following call pancis, it indicates UnimplementedSessionServiceServer 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 ( )
}
2024-10-07 14:20:25 +00:00
s . RegisterService ( & SessionService_ServiceDesc , srv )
}
func _SessionService_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 . ( SessionServiceServer ) . Create ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : SessionService_Create_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( SessionServiceServer ) . Create ( ctx , req . ( * CreateRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
// SessionService_ServiceDesc is the grpc.ServiceDesc for SessionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SessionService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "neo.fs.v2.session.SessionService" ,
HandlerType : ( * SessionServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Create" ,
Handler : _SessionService_Create_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "api/session/grpc/service.proto" ,
}