Migrate to newer grpc utilities and bump deps (#593)
* Migrate to newer grpc utilities and bump deps * Revert grpc back as it was an accidental tag
This commit is contained in:
1 parent
273cf29ba4
commit
7f00e61ab0
34 files changed
+4511
-4474
No files matched your search
@@ -7,15 +7,11 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
sessions "github.com/hashicorp/boundary/internal/gen/controller/api/resources/sessions"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
_ "google.golang.org/genproto/protobuf/field_mask"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -546,177 +542,3 @@ func file_controller_api_services_v1_session_service_proto_init() {
|
||||
file_controller_api_services_v1_session_service_proto_goTypes = nil
|
||||
file_controller_api_services_v1_session_service_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// SessionServiceClient is the client API for SessionService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#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) {
|
||||
out := new(GetSessionResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.SessionService/GetSession", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sessionServiceClient) ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) {
|
||||
out := new(ListSessionsResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.SessionService/ListSessions", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sessionServiceClient) CancelSession(ctx context.Context, in *CancelSessionRequest, opts ...grpc.CallOption) (*CancelSessionResponse, error) {
|
||||
out := new(CancelSessionResponse)
|
||||
err := c.cc.Invoke(ctx, "/controller.api.services.v1.SessionService/CancelSession", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SessionServiceServer is the server API for SessionService service.
|
||||
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)
|
||||
}
|
||||
|
||||
// UnimplementedSessionServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedSessionServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedSessionServiceServer) GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSession not implemented")
|
||||
}
|
||||
func (*UnimplementedSessionServiceServer) ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListSessions not implemented")
|
||||
}
|
||||
func (*UnimplementedSessionServiceServer) CancelSession(context.Context, *CancelSessionRequest) (*CancelSessionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelSession not implemented")
|
||||
}
|
||||
|
||||
func RegisterSessionServiceServer(s *grpc.Server, srv SessionServiceServer) {
|
||||
s.RegisterService(&_SessionService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
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,
|
||||
FullMethod: "/controller.api.services.v1.SessionService/GetSession",
|
||||
}
|
||||
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,
|
||||
FullMethod: "/controller.api.services.v1.SessionService/ListSessions",
|
||||
}
|
||||
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,
|
||||
FullMethod: "/controller.api.services.v1.SessionService/CancelSession",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SessionServiceServer).CancelSession(ctx, req.(*CancelSessionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _SessionService_serviceDesc = grpc.ServiceDesc{
|
||||
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",
|
||||
}
|
||||
Reference in new issue
Block a user