2023-11-01 16:21:17 -04:00
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
2020-10-09 13:18:53 -04:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2023-11-01 16:21:17 -04:00
// versions:
2025-05-23 09:42:26 -07:00
// - protoc-gen-go-grpc v1.5.1
2023-11-01 16:21:17 -04:00
// - protoc (unknown)
// source: controller/api/services/v1/session_service.proto
2020-10-09 13:18:53 -04:00
package services
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.
2025-05-23 09:42:26 -07:00
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
2020-10-09 13:18:53 -04:00
2023-11-01 16:21:17 -04:00
const (
SessionService_GetSession_FullMethodName = "/controller.api.services.v1.SessionService/GetSession"
SessionService_ListSessions_FullMethodName = "/controller.api.services.v1.SessionService/ListSessions"
SessionService_CancelSession_FullMethodName = "/controller.api.services.v1.SessionService/CancelSession"
)
2020-10-09 13:18:53 -04:00
// 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.
type SessionServiceClient interface {
// GetSession returns a stored Session if present. The provided request
// must include the Session ID for the Session being retrieved. If
// any that ID is missing, malformed or reference a non existing
// resource an error is returned.
GetSession ( ctx context . Context , in * GetSessionRequest , opts ... grpc . CallOption ) ( * GetSessionResponse , error )
// ListSessions returns a list of stored Sessions which exist inside the scope
// referenced inside the request. The request must include the scope ID for
// the Sessions being retrieved. If the scope ID is missing, malformed, or
// reference a non existing scope, an error is returned.
ListSessions ( ctx context . Context , in * ListSessionsRequest , opts ... grpc . CallOption ) ( * ListSessionsResponse , error )
// CancelSession cancels an existing Session in boundary. An error
// is returned if the request attempts to cancel a Session that does
// not exist.
CancelSession ( ctx context . Context , in * CancelSessionRequest , opts ... grpc . CallOption ) ( * CancelSessionResponse , error )
}
type sessionServiceClient struct {
cc grpc . ClientConnInterface
}
func NewSessionServiceClient ( cc grpc . ClientConnInterface ) SessionServiceClient {
return & sessionServiceClient { cc }
}
func ( c * sessionServiceClient ) GetSession ( ctx context . Context , in * GetSessionRequest , opts ... grpc . CallOption ) ( * GetSessionResponse , error ) {
2025-05-23 09:42:26 -07:00
cOpts := append ([] grpc . CallOption { grpc . StaticMethod ()}, opts ... )
2020-10-09 13:18:53 -04:00
out := new ( GetSessionResponse )
2025-05-23 09:42:26 -07:00
err := c . cc . Invoke ( ctx , SessionService_GetSession_FullMethodName , in , out , cOpts ... )
2020-10-09 13:18:53 -04:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * sessionServiceClient ) ListSessions ( ctx context . Context , in * ListSessionsRequest , opts ... grpc . CallOption ) ( * ListSessionsResponse , error ) {
2025-05-23 09:42:26 -07:00
cOpts := append ([] grpc . CallOption { grpc . StaticMethod ()}, opts ... )
2020-10-09 13:18:53 -04:00
out := new ( ListSessionsResponse )
2025-05-23 09:42:26 -07:00
err := c . cc . Invoke ( ctx , SessionService_ListSessions_FullMethodName , in , out , cOpts ... )
2020-10-09 13:18:53 -04:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * sessionServiceClient ) CancelSession ( ctx context . Context , in * CancelSessionRequest , opts ... grpc . CallOption ) ( * CancelSessionResponse , error ) {
2025-05-23 09:42:26 -07:00
cOpts := append ([] grpc . CallOption { grpc . StaticMethod ()}, opts ... )
2020-10-09 13:18:53 -04:00
out := new ( CancelSessionResponse )
2025-05-23 09:42:26 -07:00
err := c . cc . Invoke ( ctx , SessionService_CancelSession_FullMethodName , in , out , cOpts ... )
2020-10-09 13:18:53 -04:00
if err != nil {
return nil , err
}
return out , nil
}
// SessionServiceServer is the server API for SessionService service.
2020-11-11 14:41:05 -05:00
// All implementations must embed UnimplementedSessionServiceServer
2025-05-23 09:42:26 -07:00
// for forward compatibility.
2020-10-09 13:18:53 -04:00
type SessionServiceServer interface {
// GetSession returns a stored Session if present. The provided request
// must include the Session ID for the Session being retrieved. If
// any that ID is missing, malformed or reference a non existing
// resource an error is returned.
GetSession ( context . Context , * GetSessionRequest ) ( * GetSessionResponse , error )
// ListSessions returns a list of stored Sessions which exist inside the scope
// referenced inside the request. The request must include the scope ID for
// the Sessions being retrieved. If the scope ID is missing, malformed, or
// reference a non existing scope, an error is returned.
ListSessions ( context . Context , * ListSessionsRequest ) ( * ListSessionsResponse , error )
// CancelSession cancels an existing Session in boundary. An error
// is returned if the request attempts to cancel a Session that does
// not exist.
CancelSession ( context . Context , * CancelSessionRequest ) ( * CancelSessionResponse , error )
2020-11-11 14:41:05 -05:00
mustEmbedUnimplementedSessionServiceServer ()
2020-10-09 13:18:53 -04:00
}
2025-05-23 09:42:26 -07:00
// UnimplementedSessionServiceServer 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 UnimplementedSessionServiceServer struct {}
2020-10-09 13:18:53 -04:00
2020-11-11 14:41:05 -05:00
func ( UnimplementedSessionServiceServer ) GetSession ( context . Context , * GetSessionRequest ) ( * GetSessionResponse , error ) {
2020-10-09 13:18:53 -04:00
return nil , status . Errorf ( codes . Unimplemented , "method GetSession not implemented" )
}
2020-11-11 14:41:05 -05:00
func ( UnimplementedSessionServiceServer ) ListSessions ( context . Context , * ListSessionsRequest ) ( * ListSessionsResponse , error ) {
2020-10-09 13:18:53 -04:00
return nil , status . Errorf ( codes . Unimplemented , "method ListSessions not implemented" )
}
2020-11-11 14:41:05 -05:00
func ( UnimplementedSessionServiceServer ) CancelSession ( context . Context , * CancelSessionRequest ) ( * CancelSessionResponse , error ) {
2020-10-09 13:18:53 -04:00
return nil , status . Errorf ( codes . Unimplemented , "method CancelSession not implemented" )
}
2020-11-11 14:41:05 -05:00
func ( UnimplementedSessionServiceServer ) mustEmbedUnimplementedSessionServiceServer () {}
2025-05-23 09:42:26 -07:00
func ( UnimplementedSessionServiceServer ) testEmbeddedByValue () {}
2020-10-09 13:18:53 -04:00
2020-11-11 14:41:05 -05: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 ) {
2025-05-23 09:42:26 -07: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 ()
}
2021-02-22 12:46:00 -05:00
s . RegisterService ( & SessionService_ServiceDesc , srv )
2020-10-09 13:18:53 -04:00
}
func _SessionService_GetSession_Handler ( srv interface {}, ctx context . Context , dec func ( interface {}) error , interceptor grpc . UnaryServerInterceptor ) ( interface {}, error ) {
in := new ( GetSessionRequest )
if err := dec ( in ); err != nil {
return nil , err
}
if interceptor == nil {
return srv .( SessionServiceServer ). GetSession ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-11-01 16:21:17 -04:00
FullMethod : SessionService_GetSession_FullMethodName ,
2020-10-09 13:18:53 -04:00
}
handler := func ( ctx context . Context , req interface {}) ( interface {}, error ) {
return srv .( SessionServiceServer ). GetSession ( ctx , req .( * GetSessionRequest ))
}
return interceptor ( ctx , in , info , handler )
}
func _SessionService_ListSessions_Handler ( srv interface {}, ctx context . Context , dec func ( interface {}) error , interceptor grpc . UnaryServerInterceptor ) ( interface {}, error ) {
in := new ( ListSessionsRequest )
if err := dec ( in ); err != nil {
return nil , err
}
if interceptor == nil {
return srv .( SessionServiceServer ). ListSessions ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-11-01 16:21:17 -04:00
FullMethod : SessionService_ListSessions_FullMethodName ,
2020-10-09 13:18:53 -04:00
}
handler := func ( ctx context . Context , req interface {}) ( interface {}, error ) {
return srv .( SessionServiceServer ). ListSessions ( ctx , req .( * ListSessionsRequest ))
}
return interceptor ( ctx , in , info , handler )
}
func _SessionService_CancelSession_Handler ( srv interface {}, ctx context . Context , dec func ( interface {}) error , interceptor grpc . UnaryServerInterceptor ) ( interface {}, error ) {
in := new ( CancelSessionRequest )
if err := dec ( in ); err != nil {
return nil , err
}
if interceptor == nil {
return srv .( SessionServiceServer ). CancelSession ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-11-01 16:21:17 -04:00
FullMethod : SessionService_CancelSession_FullMethodName ,
2020-10-09 13:18:53 -04:00
}
handler := func ( ctx context . Context , req interface {}) ( interface {}, error ) {
return srv .( SessionServiceServer ). CancelSession ( ctx , req .( * CancelSessionRequest ))
}
return interceptor ( ctx , in , info , handler )
}
2021-02-22 12:46:00 -05:00
// 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 {
2020-10-09 13:18:53 -04:00
ServiceName : "controller.api.services.v1.SessionService" ,
HandlerType : ( * SessionServiceServer )( nil ),
Methods : [] grpc . MethodDesc {
{
MethodName : "GetSession" ,
Handler : _SessionService_GetSession_Handler ,
},
{
MethodName : "ListSessions" ,
Handler : _SessionService_ListSessions_Handler ,
},
{
MethodName : "CancelSession" ,
Handler : _SessionService_CancelSession_Handler ,
},
},
Streams : [] grpc . StreamDesc {},
Metadata : "controller/api/services/v1/session_service.proto" ,
}