From 097dff5be8d39e9f8d5ca15d582011e66253ffa7 Mon Sep 17 00:00:00 2001 From: Daniel Adam Date: Sun, 18 Aug 2024 10:48:25 +0200 Subject: [PATCH] Regenerate protobuf files --- certificate-authority/pb/cert.pb.go | 10 +- certificate-authority/pb/service.pb.go | 6 +- certificate-authority/pb/service.pb.gw.go | 3 +- certificate-authority/pb/service_grpc.pb.go | 83 ++-- certificate-authority/pb/signingRecords.pb.go | 16 +- grpc-gateway/pb/cancelCommands.pb.go | 12 +- grpc-gateway/pb/devices.pb.go | 66 +-- grpc-gateway/pb/events.pb.go | 12 +- grpc-gateway/pb/getDevicesMetadata.pb.go | 8 +- grpc-gateway/pb/getPendingCommands.pb.go | 12 +- grpc-gateway/pb/hubConfiguration.pb.go | 22 +- grpc-gateway/pb/service.pb.go | 6 +- grpc-gateway/pb/service_grpc.pb.go | 397 ++++++------------ grpc-gateway/pb/updateDeviceMetadata.pb.go | 10 +- identity-store/events/events.pb.go | 18 +- identity-store/pb/devices.pb.go | 18 +- identity-store/pb/service.pb.go | 6 +- identity-store/pb/service_grpc.pb.go | 80 ++-- m2m-oauth-server/pb/service.pb.go | 20 +- m2m-oauth-server/pb/service.pb.gw.go | 3 +- m2m-oauth-server/pb/service_grpc.pb.go | 80 ++-- pkg/net/grpc/stub.pb_test.go | 10 +- pkg/net/grpc/stub_grpc.pb_test.go | 91 ++-- resource-aggregate/commands/commands.pb.go | 92 ++-- resource-aggregate/commands/resources.pb.go | 18 +- .../cqrs/aggregate/test/aggregate_test.pb.go | 16 +- .../cqrs/eventbus/pb/eventbus.pb.go | 8 +- resource-aggregate/events/events.pb.go | 50 +-- resource-aggregate/service/service.pb.go | 6 +- resource-aggregate/service/service_grpc.pb.go | 81 ++-- .../pb/getLatestDeviceETags.pb.go | 10 +- resource-directory/pb/service.pb.go | 6 +- resource-directory/pb/service_grpc.pb.go | 34 +- snippet-service/pb/service.pb.go | 58 +-- snippet-service/pb/service.pb.gw.go | 3 +- snippet-service/pb/service_grpc.pb.go | 192 ++++----- 36 files changed, 676 insertions(+), 887 deletions(-) diff --git a/certificate-authority/pb/cert.pb.go b/certificate-authority/pb/cert.pb.go index 49930758d..e04582ca2 100644 --- a/certificate-authority/pb/cert.pb.go +++ b/certificate-authority/pb/cert.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: certificate-authority/pb/cert.proto package pb @@ -150,7 +150,7 @@ func file_certificate_authority_pb_cert_proto_rawDescGZIP() []byte { } var file_certificate_authority_pb_cert_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_certificate_authority_pb_cert_proto_goTypes = []interface{}{ +var file_certificate_authority_pb_cert_proto_goTypes = []any{ (*SignCertificateRequest)(nil), // 0: certificateauthority.pb.SignCertificateRequest (*SignCertificateResponse)(nil), // 1: certificateauthority.pb.SignCertificateResponse } @@ -168,7 +168,7 @@ func file_certificate_authority_pb_cert_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_certificate_authority_pb_cert_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_certificate_authority_pb_cert_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*SignCertificateRequest); i { case 0: return &v.state @@ -180,7 +180,7 @@ func file_certificate_authority_pb_cert_proto_init() { return nil } } - file_certificate_authority_pb_cert_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_certificate_authority_pb_cert_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*SignCertificateResponse); i { case 0: return &v.state diff --git a/certificate-authority/pb/service.pb.go b/certificate-authority/pb/service.pb.go index 72bb47226..58b6f5404 100644 --- a/certificate-authority/pb/service.pb.go +++ b/certificate-authority/pb/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: certificate-authority/pb/service.proto package pb @@ -106,7 +106,7 @@ var file_certificate_authority_pb_service_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x33, } -var file_certificate_authority_pb_service_proto_goTypes = []interface{}{ +var file_certificate_authority_pb_service_proto_goTypes = []any{ (*SignCertificateRequest)(nil), // 0: certificateauthority.pb.SignCertificateRequest (*GetSigningRecordsRequest)(nil), // 1: certificateauthority.pb.GetSigningRecordsRequest (*DeleteSigningRecordsRequest)(nil), // 2: certificateauthority.pb.DeleteSigningRecordsRequest diff --git a/certificate-authority/pb/service.pb.gw.go b/certificate-authority/pb/service.pb.gw.go index 4c6a95371..512269fc5 100644 --- a/certificate-authority/pb/service.pb.gw.go +++ b/certificate-authority/pb/service.pb.gw.go @@ -151,6 +151,7 @@ func local_request_CertificateAuthority_DeleteSigningRecords_0(ctx context.Conte // UnaryRPC :call CertificateAuthorityServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCertificateAuthorityHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterCertificateAuthorityHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CertificateAuthorityServer) error { mux.Handle("POST", pattern_CertificateAuthority_SignIdentityCertificate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -273,7 +274,7 @@ func RegisterCertificateAuthorityHandler(ctx context.Context, mux *runtime.Serve // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CertificateAuthorityClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CertificateAuthorityClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "CertificateAuthorityClient" to call the correct interceptors. +// "CertificateAuthorityClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterCertificateAuthorityHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CertificateAuthorityClient) error { mux.Handle("POST", pattern_CertificateAuthority_SignIdentityCertificate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { diff --git a/certificate-authority/pb/service_grpc.pb.go b/certificate-authority/pb/service_grpc.pb.go index 677e76a77..71dd16956 100644 --- a/certificate-authority/pb/service_grpc.pb.go +++ b/certificate-authority/pb/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: certificate-authority/pb/service.proto package pb @@ -15,8 +15,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( CertificateAuthority_SignIdentityCertificate_FullMethodName = "/certificateauthority.pb.CertificateAuthority/SignIdentityCertificate" @@ -36,7 +36,7 @@ type CertificateAuthorityClient interface { // and obtains a signed certificate. Both in the PEM format. SignCertificate(ctx context.Context, in *SignCertificateRequest, opts ...grpc.CallOption) (*SignCertificateResponse, error) // Get signed certficate records. - GetSigningRecords(ctx context.Context, in *GetSigningRecordsRequest, opts ...grpc.CallOption) (CertificateAuthority_GetSigningRecordsClient, error) + GetSigningRecords(ctx context.Context, in *GetSigningRecordsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SigningRecord], error) // Delete signed certficate records. DeleteSigningRecords(ctx context.Context, in *DeleteSigningRecordsRequest, opts ...grpc.CallOption) (*DeletedSigningRecords, error) } @@ -50,8 +50,9 @@ func NewCertificateAuthorityClient(cc grpc.ClientConnInterface) CertificateAutho } func (c *certificateAuthorityClient) SignIdentityCertificate(ctx context.Context, in *SignCertificateRequest, opts ...grpc.CallOption) (*SignCertificateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SignCertificateResponse) - err := c.cc.Invoke(ctx, CertificateAuthority_SignIdentityCertificate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, CertificateAuthority_SignIdentityCertificate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,20 +60,22 @@ func (c *certificateAuthorityClient) SignIdentityCertificate(ctx context.Context } func (c *certificateAuthorityClient) SignCertificate(ctx context.Context, in *SignCertificateRequest, opts ...grpc.CallOption) (*SignCertificateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SignCertificateResponse) - err := c.cc.Invoke(ctx, CertificateAuthority_SignCertificate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, CertificateAuthority_SignCertificate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *certificateAuthorityClient) GetSigningRecords(ctx context.Context, in *GetSigningRecordsRequest, opts ...grpc.CallOption) (CertificateAuthority_GetSigningRecordsClient, error) { - stream, err := c.cc.NewStream(ctx, &CertificateAuthority_ServiceDesc.Streams[0], CertificateAuthority_GetSigningRecords_FullMethodName, opts...) +func (c *certificateAuthorityClient) GetSigningRecords(ctx context.Context, in *GetSigningRecordsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SigningRecord], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &CertificateAuthority_ServiceDesc.Streams[0], CertificateAuthority_GetSigningRecords_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &certificateAuthorityGetSigningRecordsClient{stream} + x := &grpc.GenericClientStream[GetSigningRecordsRequest, SigningRecord]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -82,26 +85,13 @@ func (c *certificateAuthorityClient) GetSigningRecords(ctx context.Context, in * return x, nil } -type CertificateAuthority_GetSigningRecordsClient interface { - Recv() (*SigningRecord, error) - grpc.ClientStream -} - -type certificateAuthorityGetSigningRecordsClient struct { - grpc.ClientStream -} - -func (x *certificateAuthorityGetSigningRecordsClient) Recv() (*SigningRecord, error) { - m := new(SigningRecord) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type CertificateAuthority_GetSigningRecordsClient = grpc.ServerStreamingClient[SigningRecord] func (c *certificateAuthorityClient) DeleteSigningRecords(ctx context.Context, in *DeleteSigningRecordsRequest, opts ...grpc.CallOption) (*DeletedSigningRecords, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeletedSigningRecords) - err := c.cc.Invoke(ctx, CertificateAuthority_DeleteSigningRecords_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, CertificateAuthority_DeleteSigningRecords_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -110,7 +100,7 @@ func (c *certificateAuthorityClient) DeleteSigningRecords(ctx context.Context, i // CertificateAuthorityServer is the server API for CertificateAuthority service. // All implementations must embed UnimplementedCertificateAuthorityServer -// for forward compatibility +// for forward compatibility. type CertificateAuthorityServer interface { // SignIdentityCertificate sends a Identity Certificate Signing Request to the certificate authority // and obtains a signed certificate. Both in the PEM format. It adds EKU: '1.3.6.1.4.1.44924.1.6' . @@ -119,15 +109,18 @@ type CertificateAuthorityServer interface { // and obtains a signed certificate. Both in the PEM format. SignCertificate(context.Context, *SignCertificateRequest) (*SignCertificateResponse, error) // Get signed certficate records. - GetSigningRecords(*GetSigningRecordsRequest, CertificateAuthority_GetSigningRecordsServer) error + GetSigningRecords(*GetSigningRecordsRequest, grpc.ServerStreamingServer[SigningRecord]) error // Delete signed certficate records. DeleteSigningRecords(context.Context, *DeleteSigningRecordsRequest) (*DeletedSigningRecords, error) mustEmbedUnimplementedCertificateAuthorityServer() } -// UnimplementedCertificateAuthorityServer must be embedded to have forward compatible implementations. -type UnimplementedCertificateAuthorityServer struct { -} +// UnimplementedCertificateAuthorityServer 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 UnimplementedCertificateAuthorityServer struct{} func (UnimplementedCertificateAuthorityServer) SignIdentityCertificate(context.Context, *SignCertificateRequest) (*SignCertificateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SignIdentityCertificate not implemented") @@ -135,13 +128,14 @@ func (UnimplementedCertificateAuthorityServer) SignIdentityCertificate(context.C func (UnimplementedCertificateAuthorityServer) SignCertificate(context.Context, *SignCertificateRequest) (*SignCertificateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SignCertificate not implemented") } -func (UnimplementedCertificateAuthorityServer) GetSigningRecords(*GetSigningRecordsRequest, CertificateAuthority_GetSigningRecordsServer) error { +func (UnimplementedCertificateAuthorityServer) GetSigningRecords(*GetSigningRecordsRequest, grpc.ServerStreamingServer[SigningRecord]) error { return status.Errorf(codes.Unimplemented, "method GetSigningRecords not implemented") } func (UnimplementedCertificateAuthorityServer) DeleteSigningRecords(context.Context, *DeleteSigningRecordsRequest) (*DeletedSigningRecords, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteSigningRecords not implemented") } func (UnimplementedCertificateAuthorityServer) mustEmbedUnimplementedCertificateAuthorityServer() {} +func (UnimplementedCertificateAuthorityServer) testEmbeddedByValue() {} // UnsafeCertificateAuthorityServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to CertificateAuthorityServer will @@ -151,6 +145,13 @@ type UnsafeCertificateAuthorityServer interface { } func RegisterCertificateAuthorityServer(s grpc.ServiceRegistrar, srv CertificateAuthorityServer) { + // If the following call pancis, it indicates UnimplementedCertificateAuthorityServer 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() + } s.RegisterService(&CertificateAuthority_ServiceDesc, srv) } @@ -195,21 +196,11 @@ func _CertificateAuthority_GetSigningRecords_Handler(srv interface{}, stream grp if err := stream.RecvMsg(m); err != nil { return err } - return srv.(CertificateAuthorityServer).GetSigningRecords(m, &certificateAuthorityGetSigningRecordsServer{stream}) -} - -type CertificateAuthority_GetSigningRecordsServer interface { - Send(*SigningRecord) error - grpc.ServerStream + return srv.(CertificateAuthorityServer).GetSigningRecords(m, &grpc.GenericServerStream[GetSigningRecordsRequest, SigningRecord]{ServerStream: stream}) } -type certificateAuthorityGetSigningRecordsServer struct { - grpc.ServerStream -} - -func (x *certificateAuthorityGetSigningRecordsServer) Send(m *SigningRecord) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type CertificateAuthority_GetSigningRecordsServer = grpc.ServerStreamingServer[SigningRecord] func _CertificateAuthority_DeleteSigningRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteSigningRecordsRequest) diff --git a/certificate-authority/pb/signingRecords.pb.go b/certificate-authority/pb/signingRecords.pb.go index 96739334a..8ce4fbb3d 100644 --- a/certificate-authority/pb/signingRecords.pb.go +++ b/certificate-authority/pb/signingRecords.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: certificate-authority/pb/signingRecords.proto package pb @@ -429,7 +429,7 @@ func file_certificate_authority_pb_signingRecords_proto_rawDescGZIP() []byte { } var file_certificate_authority_pb_signingRecords_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_certificate_authority_pb_signingRecords_proto_goTypes = []interface{}{ +var file_certificate_authority_pb_signingRecords_proto_goTypes = []any{ (*GetSigningRecordsRequest)(nil), // 0: certificateauthority.pb.GetSigningRecordsRequest (*CredentialStatus)(nil), // 1: certificateauthority.pb.CredentialStatus (*SigningRecord)(nil), // 2: certificateauthority.pb.SigningRecord @@ -451,7 +451,7 @@ func file_certificate_authority_pb_signingRecords_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_certificate_authority_pb_signingRecords_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_certificate_authority_pb_signingRecords_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GetSigningRecordsRequest); i { case 0: return &v.state @@ -463,7 +463,7 @@ func file_certificate_authority_pb_signingRecords_proto_init() { return nil } } - file_certificate_authority_pb_signingRecords_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_certificate_authority_pb_signingRecords_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*CredentialStatus); i { case 0: return &v.state @@ -475,7 +475,7 @@ func file_certificate_authority_pb_signingRecords_proto_init() { return nil } } - file_certificate_authority_pb_signingRecords_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_certificate_authority_pb_signingRecords_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*SigningRecord); i { case 0: return &v.state @@ -487,7 +487,7 @@ func file_certificate_authority_pb_signingRecords_proto_init() { return nil } } - file_certificate_authority_pb_signingRecords_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_certificate_authority_pb_signingRecords_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*DeleteSigningRecordsRequest); i { case 0: return &v.state @@ -499,7 +499,7 @@ func file_certificate_authority_pb_signingRecords_proto_init() { return nil } } - file_certificate_authority_pb_signingRecords_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_certificate_authority_pb_signingRecords_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*DeletedSigningRecords); i { case 0: return &v.state diff --git a/grpc-gateway/pb/cancelCommands.pb.go b/grpc-gateway/pb/cancelCommands.pb.go index 073940ed0..25afbae65 100644 --- a/grpc-gateway/pb/cancelCommands.pb.go +++ b/grpc-gateway/pb/cancelCommands.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/cancelCommands.proto package pb @@ -227,7 +227,7 @@ func file_grpc_gateway_pb_cancelCommands_proto_rawDescGZIP() []byte { } var file_grpc_gateway_pb_cancelCommands_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_grpc_gateway_pb_cancelCommands_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_cancelCommands_proto_goTypes = []any{ (*CancelPendingCommandsRequest)(nil), // 0: grpcgateway.pb.CancelPendingCommandsRequest (*CancelPendingCommandsResponse)(nil), // 1: grpcgateway.pb.CancelPendingCommandsResponse (*CancelPendingMetadataUpdatesRequest)(nil), // 2: grpcgateway.pb.CancelPendingMetadataUpdatesRequest @@ -248,7 +248,7 @@ func file_grpc_gateway_pb_cancelCommands_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_gateway_pb_cancelCommands_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_cancelCommands_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*CancelPendingCommandsRequest); i { case 0: return &v.state @@ -260,7 +260,7 @@ func file_grpc_gateway_pb_cancelCommands_proto_init() { return nil } } - file_grpc_gateway_pb_cancelCommands_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_cancelCommands_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*CancelPendingCommandsResponse); i { case 0: return &v.state @@ -272,7 +272,7 @@ func file_grpc_gateway_pb_cancelCommands_proto_init() { return nil } } - file_grpc_gateway_pb_cancelCommands_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_cancelCommands_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*CancelPendingMetadataUpdatesRequest); i { case 0: return &v.state diff --git a/grpc-gateway/pb/devices.pb.go b/grpc-gateway/pb/devices.pb.go index 18769fa48..7c42be427 100644 --- a/grpc-gateway/pb/devices.pb.go +++ b/grpc-gateway/pb/devices.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/devices.proto package pb @@ -2745,7 +2745,7 @@ func file_grpc_gateway_pb_devices_proto_rawDescGZIP() []byte { var file_grpc_gateway_pb_devices_proto_enumTypes = make([]protoimpl.EnumInfo, 4) var file_grpc_gateway_pb_devices_proto_msgTypes = make([]protoimpl.MessageInfo, 30) -var file_grpc_gateway_pb_devices_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_devices_proto_goTypes = []any{ (GetDevicesRequest_Status)(0), // 0: grpcgateway.pb.GetDevicesRequest.Status (SubscribeToEvents_CreateSubscription_Event)(0), // 1: grpcgateway.pb.SubscribeToEvents.CreateSubscription.Event (Event_OperationProcessed_ErrorStatus_Code)(0), // 2: grpcgateway.pb.Event.OperationProcessed.ErrorStatus.Code @@ -2859,7 +2859,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_gateway_pb_devices_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GetDevicesRequest); i { case 0: return &v.state @@ -2871,7 +2871,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*DeleteDevicesRequest); i { case 0: return &v.state @@ -2883,7 +2883,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*DeleteDevicesResponse); i { case 0: return &v.state @@ -2895,7 +2895,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*GetResourceLinksRequest); i { case 0: return &v.state @@ -2907,7 +2907,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*GetResourceFromDeviceRequest); i { case 0: return &v.state @@ -2919,7 +2919,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*GetResourceFromDeviceResponse); i { case 0: return &v.state @@ -2931,7 +2931,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*ResourceIdFilter); i { case 0: return &v.state @@ -2943,7 +2943,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*GetResourcesRequest); i { case 0: return &v.state @@ -2955,7 +2955,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*Resource); i { case 0: return &v.state @@ -2967,7 +2967,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*UpdateResourceRequest); i { case 0: return &v.state @@ -2979,7 +2979,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*UpdateResourceResponse); i { case 0: return &v.state @@ -2991,7 +2991,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*SubscribeToEvents); i { case 0: return &v.state @@ -3003,7 +3003,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*Event); i { case 0: return &v.state @@ -3015,7 +3015,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*LocalizedString); i { case 0: return &v.state @@ -3027,7 +3027,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*Device); i { case 0: return &v.state @@ -3039,7 +3039,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*Content); i { case 0: return &v.state @@ -3051,7 +3051,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*DeleteResourceRequest); i { case 0: return &v.state @@ -3063,7 +3063,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*DeleteResourceResponse); i { case 0: return &v.state @@ -3075,7 +3075,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*CreateResourceRequest); i { case 0: return &v.state @@ -3087,7 +3087,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*CreateResourceResponse); i { case 0: return &v.state @@ -3099,7 +3099,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*SubscribeToEvents_CreateSubscription); i { case 0: return &v.state @@ -3111,7 +3111,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*SubscribeToEvents_CancelSubscription); i { case 0: return &v.state @@ -3123,7 +3123,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*Event_DeviceRegistered); i { case 0: return &v.state @@ -3135,7 +3135,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*Event_DeviceUnregistered); i { case 0: return &v.state @@ -3147,7 +3147,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*Event_OperationProcessed); i { case 0: return &v.state @@ -3159,7 +3159,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*Event_SubscriptionCanceled); i { case 0: return &v.state @@ -3171,7 +3171,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[28].Exporter = func(v any, i int) any { switch v := v.(*Event_OperationProcessed_ErrorStatus); i { case 0: return &v.state @@ -3183,7 +3183,7 @@ func file_grpc_gateway_pb_devices_proto_init() { return nil } } - file_grpc_gateway_pb_devices_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_devices_proto_msgTypes[29].Exporter = func(v any, i int) any { switch v := v.(*Device_Metadata); i { case 0: return &v.state @@ -3196,11 +3196,11 @@ func file_grpc_gateway_pb_devices_proto_init() { } } } - file_grpc_gateway_pb_devices_proto_msgTypes[11].OneofWrappers = []interface{}{ + file_grpc_gateway_pb_devices_proto_msgTypes[11].OneofWrappers = []any{ (*SubscribeToEvents_CreateSubscription_)(nil), (*SubscribeToEvents_CancelSubscription_)(nil), } - file_grpc_gateway_pb_devices_proto_msgTypes[12].OneofWrappers = []interface{}{ + file_grpc_gateway_pb_devices_proto_msgTypes[12].OneofWrappers = []any{ (*Event_DeviceRegistered_)(nil), (*Event_DeviceUnregistered_)(nil), (*Event_ResourcePublished)(nil), diff --git a/grpc-gateway/pb/events.pb.go b/grpc-gateway/pb/events.pb.go index 8849fd654..7575a02f1 100644 --- a/grpc-gateway/pb/events.pb.go +++ b/grpc-gateway/pb/events.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/events.proto package pb @@ -523,7 +523,7 @@ func file_grpc_gateway_pb_events_proto_rawDescGZIP() []byte { } var file_grpc_gateway_pb_events_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_grpc_gateway_pb_events_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_events_proto_goTypes = []any{ (*GetEventsRequest)(nil), // 0: grpcgateway.pb.GetEventsRequest (*GetEventsResponse)(nil), // 1: grpcgateway.pb.GetEventsResponse (*ResourceIdFilter)(nil), // 2: grpcgateway.pb.ResourceIdFilter @@ -576,7 +576,7 @@ func file_grpc_gateway_pb_events_proto_init() { } file_grpc_gateway_pb_devices_proto_init() if !protoimpl.UnsafeEnabled { - file_grpc_gateway_pb_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_events_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GetEventsRequest); i { case 0: return &v.state @@ -588,7 +588,7 @@ func file_grpc_gateway_pb_events_proto_init() { return nil } } - file_grpc_gateway_pb_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_events_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*GetEventsResponse); i { case 0: return &v.state @@ -601,7 +601,7 @@ func file_grpc_gateway_pb_events_proto_init() { } } } - file_grpc_gateway_pb_events_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_grpc_gateway_pb_events_proto_msgTypes[1].OneofWrappers = []any{ (*GetEventsResponse_ResourceLinksPublished)(nil), (*GetEventsResponse_ResourceLinksUnpublished)(nil), (*GetEventsResponse_ResourceLinksSnapshotTaken)(nil), diff --git a/grpc-gateway/pb/getDevicesMetadata.pb.go b/grpc-gateway/pb/getDevicesMetadata.pb.go index e2a2dbd43..2166418f9 100644 --- a/grpc-gateway/pb/getDevicesMetadata.pb.go +++ b/grpc-gateway/pb/getDevicesMetadata.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/getDevicesMetadata.proto package pb @@ -107,7 +107,7 @@ func file_grpc_gateway_pb_getDevicesMetadata_proto_rawDescGZIP() []byte { } var file_grpc_gateway_pb_getDevicesMetadata_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_grpc_gateway_pb_getDevicesMetadata_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_getDevicesMetadata_proto_goTypes = []any{ (*GetDevicesMetadataRequest)(nil), // 0: grpcgateway.pb.GetDevicesMetadataRequest } var file_grpc_gateway_pb_getDevicesMetadata_proto_depIdxs = []int32{ @@ -124,7 +124,7 @@ func file_grpc_gateway_pb_getDevicesMetadata_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_gateway_pb_getDevicesMetadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_getDevicesMetadata_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GetDevicesMetadataRequest); i { case 0: return &v.state diff --git a/grpc-gateway/pb/getPendingCommands.pb.go b/grpc-gateway/pb/getPendingCommands.pb.go index ba2113eac..2cb61228b 100644 --- a/grpc-gateway/pb/getPendingCommands.pb.go +++ b/grpc-gateway/pb/getPendingCommands.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/getPendingCommands.proto package pb @@ -387,7 +387,7 @@ func file_grpc_gateway_pb_getPendingCommands_proto_rawDescGZIP() []byte { var file_grpc_gateway_pb_getPendingCommands_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_grpc_gateway_pb_getPendingCommands_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_grpc_gateway_pb_getPendingCommands_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_getPendingCommands_proto_goTypes = []any{ (GetPendingCommandsRequest_Command)(0), // 0: grpcgateway.pb.GetPendingCommandsRequest.Command (*GetPendingCommandsRequest)(nil), // 1: grpcgateway.pb.GetPendingCommandsRequest (*PendingCommand)(nil), // 2: grpcgateway.pb.PendingCommand @@ -420,7 +420,7 @@ func file_grpc_gateway_pb_getPendingCommands_proto_init() { } file_grpc_gateway_pb_devices_proto_init() if !protoimpl.UnsafeEnabled { - file_grpc_gateway_pb_getPendingCommands_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_getPendingCommands_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GetPendingCommandsRequest); i { case 0: return &v.state @@ -432,7 +432,7 @@ func file_grpc_gateway_pb_getPendingCommands_proto_init() { return nil } } - file_grpc_gateway_pb_getPendingCommands_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_getPendingCommands_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*PendingCommand); i { case 0: return &v.state @@ -445,7 +445,7 @@ func file_grpc_gateway_pb_getPendingCommands_proto_init() { } } } - file_grpc_gateway_pb_getPendingCommands_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_grpc_gateway_pb_getPendingCommands_proto_msgTypes[1].OneofWrappers = []any{ (*PendingCommand_ResourceCreatePending)(nil), (*PendingCommand_ResourceRetrievePending)(nil), (*PendingCommand_ResourceUpdatePending)(nil), diff --git a/grpc-gateway/pb/hubConfiguration.pb.go b/grpc-gateway/pb/hubConfiguration.pb.go index 716c681e5..5f8a509d3 100644 --- a/grpc-gateway/pb/hubConfiguration.pb.go +++ b/grpc-gateway/pb/hubConfiguration.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/hubConfiguration.proto package pb @@ -66,7 +66,7 @@ type OAuthClient struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"clientID"` // @gotags: yaml:"clientID" Audience string `protobuf:"bytes,2,opt,name=audience,proto3" json:"audience,omitempty"` Scopes []string `protobuf:"bytes,3,rep,name=scopes,proto3" json:"scopes,omitempty"` - ProviderName string `protobuf:"bytes,4,opt,name=provider_name,json=providerName,proto3" json:"provider_name,omitempty" yaml:"providerName"` // @gotags: yaml:"providerName" + ProviderName string `protobuf:"bytes,4,opt,name=provider_name,json=providerName,proto3" json:"provider_name,omitempty" yaml:"providerName"` // @gotags: yaml:"providerName" ClientAssertionType string `protobuf:"bytes,5,opt,name=client_assertion_type,json=clientAssertionType,proto3" json:"client_assertion_type,omitempty" yaml:"clientAssertionType"` // @gotags: yaml:"clientAssertionType" Authority string `protobuf:"bytes,6,opt,name=authority,proto3" json:"authority,omitempty"` GrantType string `protobuf:"bytes,7,opt,name=grant_type,json=grantType,proto3" json:"grant_type,omitempty" yaml:"grantType"` // @gotags: yaml:"grantType" @@ -830,7 +830,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_rawDescGZIP() []byte { } var file_grpc_gateway_pb_hubConfiguration_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_grpc_gateway_pb_hubConfiguration_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_hubConfiguration_proto_goTypes = []any{ (*HubConfigurationRequest)(nil), // 0: grpcgateway.pb.HubConfigurationRequest (*OAuthClient)(nil), // 1: grpcgateway.pb.OAuthClient (*BuildInfo)(nil), // 2: grpcgateway.pb.BuildInfo @@ -860,7 +860,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*HubConfigurationRequest); i { case 0: return &v.state @@ -872,7 +872,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_init() { return nil } } - file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*OAuthClient); i { case 0: return &v.state @@ -884,7 +884,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_init() { return nil } } - file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*BuildInfo); i { case 0: return &v.state @@ -896,7 +896,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_init() { return nil } } - file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*UIVisibility); i { case 0: return &v.state @@ -908,7 +908,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_init() { return nil } } - file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*UIConfiguration); i { case 0: return &v.state @@ -920,7 +920,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_init() { return nil } } - file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*HubConfigurationResponse); i { case 0: return &v.state @@ -932,7 +932,7 @@ func file_grpc_gateway_pb_hubConfiguration_proto_init() { return nil } } - file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_hubConfiguration_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*UIVisibility_MainSidebar); i { case 0: return &v.state diff --git a/grpc-gateway/pb/service.pb.go b/grpc-gateway/pb/service.pb.go index 0d8e261a5..9b2ddfb21 100644 --- a/grpc-gateway/pb/service.pb.go +++ b/grpc-gateway/pb/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/service.proto package pb @@ -239,7 +239,7 @@ var file_grpc_gateway_pb_service_proto_rawDesc = []byte{ 0x74, 0x6f, 0x33, } -var file_grpc_gateway_pb_service_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_service_proto_goTypes = []any{ (*GetDevicesRequest)(nil), // 0: grpcgateway.pb.GetDevicesRequest (*DeleteDevicesRequest)(nil), // 1: grpcgateway.pb.DeleteDevicesRequest (*GetResourceLinksRequest)(nil), // 2: grpcgateway.pb.GetResourceLinksRequest diff --git a/grpc-gateway/pb/service_grpc.pb.go b/grpc-gateway/pb/service_grpc.pb.go index a938d57cb..28b305296 100644 --- a/grpc-gateway/pb/service_grpc.pb.go +++ b/grpc-gateway/pb/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: grpc-gateway/pb/service.proto package pb @@ -16,8 +16,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( GrpcGateway_GetDevices_FullMethodName = "/grpcgateway.pb.GrpcGateway/GetDevices" @@ -43,20 +43,20 @@ const ( // 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 GrpcGatewayClient interface { // Get all devices - GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (GrpcGateway_GetDevicesClient, error) + GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Device], error) // Delete selected devices. DeleteDevices(ctx context.Context, in *DeleteDevicesRequest, opts ...grpc.CallOption) (*DeleteDevicesResponse, error) // Get resource links of devices. - GetResourceLinks(ctx context.Context, in *GetResourceLinksRequest, opts ...grpc.CallOption) (GrpcGateway_GetResourceLinksClient, error) + GetResourceLinks(ctx context.Context, in *GetResourceLinksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[events.ResourceLinksPublished], error) // Get resource from the device. GetResourceFromDevice(ctx context.Context, in *GetResourceFromDeviceRequest, opts ...grpc.CallOption) (*GetResourceFromDeviceResponse, error) // Get resources from the resource shadow. - GetResources(ctx context.Context, in *GetResourcesRequest, opts ...grpc.CallOption) (GrpcGateway_GetResourcesClient, error) + GetResources(ctx context.Context, in *GetResourcesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Resource], error) // Update resource at the device. UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) // When the client creates a subscription. // Subscription doesn't guarantee that all events will be sent to the client. The client is responsible for synchronize events. - SubscribeToEvents(ctx context.Context, opts ...grpc.CallOption) (GrpcGateway_SubscribeToEventsClient, error) + SubscribeToEvents(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SubscribeToEvents, Event], error) // Get cloud configuration GetHubConfiguration(ctx context.Context, in *HubConfigurationRequest, opts ...grpc.CallOption) (*HubConfigurationResponse, error) // Delete resource at the device. @@ -66,15 +66,15 @@ type GrpcGatewayClient interface { // Enables/disables shadow synchronization for device. UpdateDeviceMetadata(ctx context.Context, in *UpdateDeviceMetadataRequest, opts ...grpc.CallOption) (*UpdateDeviceMetadataResponse, error) // Gets pending commands for devices . - GetPendingCommands(ctx context.Context, in *GetPendingCommandsRequest, opts ...grpc.CallOption) (GrpcGateway_GetPendingCommandsClient, error) + GetPendingCommands(ctx context.Context, in *GetPendingCommandsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PendingCommand], error) // Cancels resource commands. CancelPendingCommands(ctx context.Context, in *CancelPendingCommandsRequest, opts ...grpc.CallOption) (*CancelPendingCommandsResponse, error) // Cancels device metadata updates. CancelPendingMetadataUpdates(ctx context.Context, in *CancelPendingMetadataUpdatesRequest, opts ...grpc.CallOption) (*CancelPendingCommandsResponse, error) // Gets metadata of the devices. Is contains online/offline or shadown synchronization status. - GetDevicesMetadata(ctx context.Context, in *GetDevicesMetadataRequest, opts ...grpc.CallOption) (GrpcGateway_GetDevicesMetadataClient, error) + GetDevicesMetadata(ctx context.Context, in *GetDevicesMetadataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[events.DeviceMetadataUpdated], error) // Get events for given combination of device id, resource id and timestamp - GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (GrpcGateway_GetEventsClient, error) + GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetEventsResponse], error) } type grpcGatewayClient struct { @@ -85,12 +85,13 @@ func NewGrpcGatewayClient(cc grpc.ClientConnInterface) GrpcGatewayClient { return &grpcGatewayClient{cc} } -func (c *grpcGatewayClient) GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (GrpcGateway_GetDevicesClient, error) { - stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[0], GrpcGateway_GetDevices_FullMethodName, opts...) +func (c *grpcGatewayClient) GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Device], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[0], GrpcGateway_GetDevices_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpcGatewayGetDevicesClient{stream} + x := &grpc.GenericClientStream[GetDevicesRequest, Device]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -100,38 +101,26 @@ func (c *grpcGatewayClient) GetDevices(ctx context.Context, in *GetDevicesReques return x, nil } -type GrpcGateway_GetDevicesClient interface { - Recv() (*Device, error) - grpc.ClientStream -} - -type grpcGatewayGetDevicesClient struct { - grpc.ClientStream -} - -func (x *grpcGatewayGetDevicesClient) Recv() (*Device, error) { - m := new(Device) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetDevicesClient = grpc.ServerStreamingClient[Device] func (c *grpcGatewayClient) DeleteDevices(ctx context.Context, in *DeleteDevicesRequest, opts ...grpc.CallOption) (*DeleteDevicesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteDevicesResponse) - err := c.cc.Invoke(ctx, GrpcGateway_DeleteDevices_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_DeleteDevices_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *grpcGatewayClient) GetResourceLinks(ctx context.Context, in *GetResourceLinksRequest, opts ...grpc.CallOption) (GrpcGateway_GetResourceLinksClient, error) { - stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[1], GrpcGateway_GetResourceLinks_FullMethodName, opts...) +func (c *grpcGatewayClient) GetResourceLinks(ctx context.Context, in *GetResourceLinksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[events.ResourceLinksPublished], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[1], GrpcGateway_GetResourceLinks_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpcGatewayGetResourceLinksClient{stream} + x := &grpc.GenericClientStream[GetResourceLinksRequest, events.ResourceLinksPublished]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -141,38 +130,26 @@ func (c *grpcGatewayClient) GetResourceLinks(ctx context.Context, in *GetResourc return x, nil } -type GrpcGateway_GetResourceLinksClient interface { - Recv() (*events.ResourceLinksPublished, error) - grpc.ClientStream -} - -type grpcGatewayGetResourceLinksClient struct { - grpc.ClientStream -} - -func (x *grpcGatewayGetResourceLinksClient) Recv() (*events.ResourceLinksPublished, error) { - m := new(events.ResourceLinksPublished) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetResourceLinksClient = grpc.ServerStreamingClient[events.ResourceLinksPublished] func (c *grpcGatewayClient) GetResourceFromDevice(ctx context.Context, in *GetResourceFromDeviceRequest, opts ...grpc.CallOption) (*GetResourceFromDeviceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetResourceFromDeviceResponse) - err := c.cc.Invoke(ctx, GrpcGateway_GetResourceFromDevice_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_GetResourceFromDevice_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *grpcGatewayClient) GetResources(ctx context.Context, in *GetResourcesRequest, opts ...grpc.CallOption) (GrpcGateway_GetResourcesClient, error) { - stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[2], GrpcGateway_GetResources_FullMethodName, opts...) +func (c *grpcGatewayClient) GetResources(ctx context.Context, in *GetResourcesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Resource], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[2], GrpcGateway_GetResources_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpcGatewayGetResourcesClient{stream} + x := &grpc.GenericClientStream[GetResourcesRequest, Resource]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -182,66 +159,36 @@ func (c *grpcGatewayClient) GetResources(ctx context.Context, in *GetResourcesRe return x, nil } -type GrpcGateway_GetResourcesClient interface { - Recv() (*Resource, error) - grpc.ClientStream -} - -type grpcGatewayGetResourcesClient struct { - grpc.ClientStream -} - -func (x *grpcGatewayGetResourcesClient) Recv() (*Resource, error) { - m := new(Resource) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetResourcesClient = grpc.ServerStreamingClient[Resource] func (c *grpcGatewayClient) UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UpdateResourceResponse) - err := c.cc.Invoke(ctx, GrpcGateway_UpdateResource_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_UpdateResource_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *grpcGatewayClient) SubscribeToEvents(ctx context.Context, opts ...grpc.CallOption) (GrpcGateway_SubscribeToEventsClient, error) { - stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[3], GrpcGateway_SubscribeToEvents_FullMethodName, opts...) +func (c *grpcGatewayClient) SubscribeToEvents(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SubscribeToEvents, Event], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[3], GrpcGateway_SubscribeToEvents_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpcGatewaySubscribeToEventsClient{stream} + x := &grpc.GenericClientStream[SubscribeToEvents, Event]{ClientStream: stream} return x, nil } -type GrpcGateway_SubscribeToEventsClient interface { - Send(*SubscribeToEvents) error - Recv() (*Event, error) - grpc.ClientStream -} - -type grpcGatewaySubscribeToEventsClient struct { - grpc.ClientStream -} - -func (x *grpcGatewaySubscribeToEventsClient) Send(m *SubscribeToEvents) error { - return x.ClientStream.SendMsg(m) -} - -func (x *grpcGatewaySubscribeToEventsClient) Recv() (*Event, error) { - m := new(Event) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_SubscribeToEventsClient = grpc.BidiStreamingClient[SubscribeToEvents, Event] func (c *grpcGatewayClient) GetHubConfiguration(ctx context.Context, in *HubConfigurationRequest, opts ...grpc.CallOption) (*HubConfigurationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(HubConfigurationResponse) - err := c.cc.Invoke(ctx, GrpcGateway_GetHubConfiguration_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_GetHubConfiguration_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -249,8 +196,9 @@ func (c *grpcGatewayClient) GetHubConfiguration(ctx context.Context, in *HubConf } func (c *grpcGatewayClient) DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*DeleteResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteResourceResponse) - err := c.cc.Invoke(ctx, GrpcGateway_DeleteResource_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_DeleteResource_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -258,8 +206,9 @@ func (c *grpcGatewayClient) DeleteResource(ctx context.Context, in *DeleteResour } func (c *grpcGatewayClient) CreateResource(ctx context.Context, in *CreateResourceRequest, opts ...grpc.CallOption) (*CreateResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CreateResourceResponse) - err := c.cc.Invoke(ctx, GrpcGateway_CreateResource_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_CreateResource_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -267,20 +216,22 @@ func (c *grpcGatewayClient) CreateResource(ctx context.Context, in *CreateResour } func (c *grpcGatewayClient) UpdateDeviceMetadata(ctx context.Context, in *UpdateDeviceMetadataRequest, opts ...grpc.CallOption) (*UpdateDeviceMetadataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UpdateDeviceMetadataResponse) - err := c.cc.Invoke(ctx, GrpcGateway_UpdateDeviceMetadata_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_UpdateDeviceMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *grpcGatewayClient) GetPendingCommands(ctx context.Context, in *GetPendingCommandsRequest, opts ...grpc.CallOption) (GrpcGateway_GetPendingCommandsClient, error) { - stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[4], GrpcGateway_GetPendingCommands_FullMethodName, opts...) +func (c *grpcGatewayClient) GetPendingCommands(ctx context.Context, in *GetPendingCommandsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PendingCommand], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[4], GrpcGateway_GetPendingCommands_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpcGatewayGetPendingCommandsClient{stream} + x := &grpc.GenericClientStream[GetPendingCommandsRequest, PendingCommand]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -290,26 +241,13 @@ func (c *grpcGatewayClient) GetPendingCommands(ctx context.Context, in *GetPendi return x, nil } -type GrpcGateway_GetPendingCommandsClient interface { - Recv() (*PendingCommand, error) - grpc.ClientStream -} - -type grpcGatewayGetPendingCommandsClient struct { - grpc.ClientStream -} - -func (x *grpcGatewayGetPendingCommandsClient) Recv() (*PendingCommand, error) { - m := new(PendingCommand) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetPendingCommandsClient = grpc.ServerStreamingClient[PendingCommand] func (c *grpcGatewayClient) CancelPendingCommands(ctx context.Context, in *CancelPendingCommandsRequest, opts ...grpc.CallOption) (*CancelPendingCommandsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CancelPendingCommandsResponse) - err := c.cc.Invoke(ctx, GrpcGateway_CancelPendingCommands_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_CancelPendingCommands_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -317,20 +255,22 @@ func (c *grpcGatewayClient) CancelPendingCommands(ctx context.Context, in *Cance } func (c *grpcGatewayClient) CancelPendingMetadataUpdates(ctx context.Context, in *CancelPendingMetadataUpdatesRequest, opts ...grpc.CallOption) (*CancelPendingCommandsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CancelPendingCommandsResponse) - err := c.cc.Invoke(ctx, GrpcGateway_CancelPendingMetadataUpdates_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, GrpcGateway_CancelPendingMetadataUpdates_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *grpcGatewayClient) GetDevicesMetadata(ctx context.Context, in *GetDevicesMetadataRequest, opts ...grpc.CallOption) (GrpcGateway_GetDevicesMetadataClient, error) { - stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[5], GrpcGateway_GetDevicesMetadata_FullMethodName, opts...) +func (c *grpcGatewayClient) GetDevicesMetadata(ctx context.Context, in *GetDevicesMetadataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[events.DeviceMetadataUpdated], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[5], GrpcGateway_GetDevicesMetadata_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpcGatewayGetDevicesMetadataClient{stream} + x := &grpc.GenericClientStream[GetDevicesMetadataRequest, events.DeviceMetadataUpdated]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -340,29 +280,16 @@ func (c *grpcGatewayClient) GetDevicesMetadata(ctx context.Context, in *GetDevic return x, nil } -type GrpcGateway_GetDevicesMetadataClient interface { - Recv() (*events.DeviceMetadataUpdated, error) - grpc.ClientStream -} - -type grpcGatewayGetDevicesMetadataClient struct { - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetDevicesMetadataClient = grpc.ServerStreamingClient[events.DeviceMetadataUpdated] -func (x *grpcGatewayGetDevicesMetadataClient) Recv() (*events.DeviceMetadataUpdated, error) { - m := new(events.DeviceMetadataUpdated) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *grpcGatewayClient) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (GrpcGateway_GetEventsClient, error) { - stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[6], GrpcGateway_GetEvents_FullMethodName, opts...) +func (c *grpcGatewayClient) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetEventsResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &GrpcGateway_ServiceDesc.Streams[6], GrpcGateway_GetEvents_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpcGatewayGetEventsClient{stream} + x := &grpc.GenericClientStream[GetEventsRequest, GetEventsResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -372,42 +299,28 @@ func (c *grpcGatewayClient) GetEvents(ctx context.Context, in *GetEventsRequest, return x, nil } -type GrpcGateway_GetEventsClient interface { - Recv() (*GetEventsResponse, error) - grpc.ClientStream -} - -type grpcGatewayGetEventsClient struct { - grpc.ClientStream -} - -func (x *grpcGatewayGetEventsClient) Recv() (*GetEventsResponse, error) { - m := new(GetEventsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetEventsClient = grpc.ServerStreamingClient[GetEventsResponse] // GrpcGatewayServer is the server API for GrpcGateway service. // All implementations must embed UnimplementedGrpcGatewayServer -// for forward compatibility +// for forward compatibility. type GrpcGatewayServer interface { // Get all devices - GetDevices(*GetDevicesRequest, GrpcGateway_GetDevicesServer) error + GetDevices(*GetDevicesRequest, grpc.ServerStreamingServer[Device]) error // Delete selected devices. DeleteDevices(context.Context, *DeleteDevicesRequest) (*DeleteDevicesResponse, error) // Get resource links of devices. - GetResourceLinks(*GetResourceLinksRequest, GrpcGateway_GetResourceLinksServer) error + GetResourceLinks(*GetResourceLinksRequest, grpc.ServerStreamingServer[events.ResourceLinksPublished]) error // Get resource from the device. GetResourceFromDevice(context.Context, *GetResourceFromDeviceRequest) (*GetResourceFromDeviceResponse, error) // Get resources from the resource shadow. - GetResources(*GetResourcesRequest, GrpcGateway_GetResourcesServer) error + GetResources(*GetResourcesRequest, grpc.ServerStreamingServer[Resource]) error // Update resource at the device. UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) // When the client creates a subscription. // Subscription doesn't guarantee that all events will be sent to the client. The client is responsible for synchronize events. - SubscribeToEvents(GrpcGateway_SubscribeToEventsServer) error + SubscribeToEvents(grpc.BidiStreamingServer[SubscribeToEvents, Event]) error // Get cloud configuration GetHubConfiguration(context.Context, *HubConfigurationRequest) (*HubConfigurationResponse, error) // Delete resource at the device. @@ -417,41 +330,44 @@ type GrpcGatewayServer interface { // Enables/disables shadow synchronization for device. UpdateDeviceMetadata(context.Context, *UpdateDeviceMetadataRequest) (*UpdateDeviceMetadataResponse, error) // Gets pending commands for devices . - GetPendingCommands(*GetPendingCommandsRequest, GrpcGateway_GetPendingCommandsServer) error + GetPendingCommands(*GetPendingCommandsRequest, grpc.ServerStreamingServer[PendingCommand]) error // Cancels resource commands. CancelPendingCommands(context.Context, *CancelPendingCommandsRequest) (*CancelPendingCommandsResponse, error) // Cancels device metadata updates. CancelPendingMetadataUpdates(context.Context, *CancelPendingMetadataUpdatesRequest) (*CancelPendingCommandsResponse, error) // Gets metadata of the devices. Is contains online/offline or shadown synchronization status. - GetDevicesMetadata(*GetDevicesMetadataRequest, GrpcGateway_GetDevicesMetadataServer) error + GetDevicesMetadata(*GetDevicesMetadataRequest, grpc.ServerStreamingServer[events.DeviceMetadataUpdated]) error // Get events for given combination of device id, resource id and timestamp - GetEvents(*GetEventsRequest, GrpcGateway_GetEventsServer) error + GetEvents(*GetEventsRequest, grpc.ServerStreamingServer[GetEventsResponse]) error mustEmbedUnimplementedGrpcGatewayServer() } -// UnimplementedGrpcGatewayServer must be embedded to have forward compatible implementations. -type UnimplementedGrpcGatewayServer struct { -} +// UnimplementedGrpcGatewayServer 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 UnimplementedGrpcGatewayServer struct{} -func (UnimplementedGrpcGatewayServer) GetDevices(*GetDevicesRequest, GrpcGateway_GetDevicesServer) error { +func (UnimplementedGrpcGatewayServer) GetDevices(*GetDevicesRequest, grpc.ServerStreamingServer[Device]) error { return status.Errorf(codes.Unimplemented, "method GetDevices not implemented") } func (UnimplementedGrpcGatewayServer) DeleteDevices(context.Context, *DeleteDevicesRequest) (*DeleteDevicesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteDevices not implemented") } -func (UnimplementedGrpcGatewayServer) GetResourceLinks(*GetResourceLinksRequest, GrpcGateway_GetResourceLinksServer) error { +func (UnimplementedGrpcGatewayServer) GetResourceLinks(*GetResourceLinksRequest, grpc.ServerStreamingServer[events.ResourceLinksPublished]) error { return status.Errorf(codes.Unimplemented, "method GetResourceLinks not implemented") } func (UnimplementedGrpcGatewayServer) GetResourceFromDevice(context.Context, *GetResourceFromDeviceRequest) (*GetResourceFromDeviceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetResourceFromDevice not implemented") } -func (UnimplementedGrpcGatewayServer) GetResources(*GetResourcesRequest, GrpcGateway_GetResourcesServer) error { +func (UnimplementedGrpcGatewayServer) GetResources(*GetResourcesRequest, grpc.ServerStreamingServer[Resource]) error { return status.Errorf(codes.Unimplemented, "method GetResources not implemented") } func (UnimplementedGrpcGatewayServer) UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateResource not implemented") } -func (UnimplementedGrpcGatewayServer) SubscribeToEvents(GrpcGateway_SubscribeToEventsServer) error { +func (UnimplementedGrpcGatewayServer) SubscribeToEvents(grpc.BidiStreamingServer[SubscribeToEvents, Event]) error { return status.Errorf(codes.Unimplemented, "method SubscribeToEvents not implemented") } func (UnimplementedGrpcGatewayServer) GetHubConfiguration(context.Context, *HubConfigurationRequest) (*HubConfigurationResponse, error) { @@ -466,7 +382,7 @@ func (UnimplementedGrpcGatewayServer) CreateResource(context.Context, *CreateRes func (UnimplementedGrpcGatewayServer) UpdateDeviceMetadata(context.Context, *UpdateDeviceMetadataRequest) (*UpdateDeviceMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateDeviceMetadata not implemented") } -func (UnimplementedGrpcGatewayServer) GetPendingCommands(*GetPendingCommandsRequest, GrpcGateway_GetPendingCommandsServer) error { +func (UnimplementedGrpcGatewayServer) GetPendingCommands(*GetPendingCommandsRequest, grpc.ServerStreamingServer[PendingCommand]) error { return status.Errorf(codes.Unimplemented, "method GetPendingCommands not implemented") } func (UnimplementedGrpcGatewayServer) CancelPendingCommands(context.Context, *CancelPendingCommandsRequest) (*CancelPendingCommandsResponse, error) { @@ -475,13 +391,14 @@ func (UnimplementedGrpcGatewayServer) CancelPendingCommands(context.Context, *Ca func (UnimplementedGrpcGatewayServer) CancelPendingMetadataUpdates(context.Context, *CancelPendingMetadataUpdatesRequest) (*CancelPendingCommandsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelPendingMetadataUpdates not implemented") } -func (UnimplementedGrpcGatewayServer) GetDevicesMetadata(*GetDevicesMetadataRequest, GrpcGateway_GetDevicesMetadataServer) error { +func (UnimplementedGrpcGatewayServer) GetDevicesMetadata(*GetDevicesMetadataRequest, grpc.ServerStreamingServer[events.DeviceMetadataUpdated]) error { return status.Errorf(codes.Unimplemented, "method GetDevicesMetadata not implemented") } -func (UnimplementedGrpcGatewayServer) GetEvents(*GetEventsRequest, GrpcGateway_GetEventsServer) error { +func (UnimplementedGrpcGatewayServer) GetEvents(*GetEventsRequest, grpc.ServerStreamingServer[GetEventsResponse]) error { return status.Errorf(codes.Unimplemented, "method GetEvents not implemented") } func (UnimplementedGrpcGatewayServer) mustEmbedUnimplementedGrpcGatewayServer() {} +func (UnimplementedGrpcGatewayServer) testEmbeddedByValue() {} // UnsafeGrpcGatewayServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to GrpcGatewayServer will @@ -491,6 +408,13 @@ type UnsafeGrpcGatewayServer interface { } func RegisterGrpcGatewayServer(s grpc.ServiceRegistrar, srv GrpcGatewayServer) { + // If the following call pancis, it indicates UnimplementedGrpcGatewayServer 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() + } s.RegisterService(&GrpcGateway_ServiceDesc, srv) } @@ -499,21 +423,11 @@ func _GrpcGateway_GetDevices_Handler(srv interface{}, stream grpc.ServerStream) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(GrpcGatewayServer).GetDevices(m, &grpcGatewayGetDevicesServer{stream}) -} - -type GrpcGateway_GetDevicesServer interface { - Send(*Device) error - grpc.ServerStream + return srv.(GrpcGatewayServer).GetDevices(m, &grpc.GenericServerStream[GetDevicesRequest, Device]{ServerStream: stream}) } -type grpcGatewayGetDevicesServer struct { - grpc.ServerStream -} - -func (x *grpcGatewayGetDevicesServer) Send(m *Device) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetDevicesServer = grpc.ServerStreamingServer[Device] func _GrpcGateway_DeleteDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteDevicesRequest) @@ -538,21 +452,11 @@ func _GrpcGateway_GetResourceLinks_Handler(srv interface{}, stream grpc.ServerSt if err := stream.RecvMsg(m); err != nil { return err } - return srv.(GrpcGatewayServer).GetResourceLinks(m, &grpcGatewayGetResourceLinksServer{stream}) + return srv.(GrpcGatewayServer).GetResourceLinks(m, &grpc.GenericServerStream[GetResourceLinksRequest, events.ResourceLinksPublished]{ServerStream: stream}) } -type GrpcGateway_GetResourceLinksServer interface { - Send(*events.ResourceLinksPublished) error - grpc.ServerStream -} - -type grpcGatewayGetResourceLinksServer struct { - grpc.ServerStream -} - -func (x *grpcGatewayGetResourceLinksServer) Send(m *events.ResourceLinksPublished) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetResourceLinksServer = grpc.ServerStreamingServer[events.ResourceLinksPublished] func _GrpcGateway_GetResourceFromDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetResourceFromDeviceRequest) @@ -577,21 +481,11 @@ func _GrpcGateway_GetResources_Handler(srv interface{}, stream grpc.ServerStream if err := stream.RecvMsg(m); err != nil { return err } - return srv.(GrpcGatewayServer).GetResources(m, &grpcGatewayGetResourcesServer{stream}) + return srv.(GrpcGatewayServer).GetResources(m, &grpc.GenericServerStream[GetResourcesRequest, Resource]{ServerStream: stream}) } -type GrpcGateway_GetResourcesServer interface { - Send(*Resource) error - grpc.ServerStream -} - -type grpcGatewayGetResourcesServer struct { - grpc.ServerStream -} - -func (x *grpcGatewayGetResourcesServer) Send(m *Resource) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetResourcesServer = grpc.ServerStreamingServer[Resource] func _GrpcGateway_UpdateResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateResourceRequest) @@ -612,30 +506,11 @@ func _GrpcGateway_UpdateResource_Handler(srv interface{}, ctx context.Context, d } func _GrpcGateway_SubscribeToEvents_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(GrpcGatewayServer).SubscribeToEvents(&grpcGatewaySubscribeToEventsServer{stream}) -} - -type GrpcGateway_SubscribeToEventsServer interface { - Send(*Event) error - Recv() (*SubscribeToEvents, error) - grpc.ServerStream -} - -type grpcGatewaySubscribeToEventsServer struct { - grpc.ServerStream + return srv.(GrpcGatewayServer).SubscribeToEvents(&grpc.GenericServerStream[SubscribeToEvents, Event]{ServerStream: stream}) } -func (x *grpcGatewaySubscribeToEventsServer) Send(m *Event) error { - return x.ServerStream.SendMsg(m) -} - -func (x *grpcGatewaySubscribeToEventsServer) Recv() (*SubscribeToEvents, error) { - m := new(SubscribeToEvents) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_SubscribeToEventsServer = grpc.BidiStreamingServer[SubscribeToEvents, Event] func _GrpcGateway_GetHubConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(HubConfigurationRequest) @@ -714,21 +589,11 @@ func _GrpcGateway_GetPendingCommands_Handler(srv interface{}, stream grpc.Server if err := stream.RecvMsg(m); err != nil { return err } - return srv.(GrpcGatewayServer).GetPendingCommands(m, &grpcGatewayGetPendingCommandsServer{stream}) -} - -type GrpcGateway_GetPendingCommandsServer interface { - Send(*PendingCommand) error - grpc.ServerStream + return srv.(GrpcGatewayServer).GetPendingCommands(m, &grpc.GenericServerStream[GetPendingCommandsRequest, PendingCommand]{ServerStream: stream}) } -type grpcGatewayGetPendingCommandsServer struct { - grpc.ServerStream -} - -func (x *grpcGatewayGetPendingCommandsServer) Send(m *PendingCommand) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetPendingCommandsServer = grpc.ServerStreamingServer[PendingCommand] func _GrpcGateway_CancelPendingCommands_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CancelPendingCommandsRequest) @@ -771,42 +636,22 @@ func _GrpcGateway_GetDevicesMetadata_Handler(srv interface{}, stream grpc.Server if err := stream.RecvMsg(m); err != nil { return err } - return srv.(GrpcGatewayServer).GetDevicesMetadata(m, &grpcGatewayGetDevicesMetadataServer{stream}) -} - -type GrpcGateway_GetDevicesMetadataServer interface { - Send(*events.DeviceMetadataUpdated) error - grpc.ServerStream + return srv.(GrpcGatewayServer).GetDevicesMetadata(m, &grpc.GenericServerStream[GetDevicesMetadataRequest, events.DeviceMetadataUpdated]{ServerStream: stream}) } -type grpcGatewayGetDevicesMetadataServer struct { - grpc.ServerStream -} - -func (x *grpcGatewayGetDevicesMetadataServer) Send(m *events.DeviceMetadataUpdated) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetDevicesMetadataServer = grpc.ServerStreamingServer[events.DeviceMetadataUpdated] func _GrpcGateway_GetEvents_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(GetEventsRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(GrpcGatewayServer).GetEvents(m, &grpcGatewayGetEventsServer{stream}) + return srv.(GrpcGatewayServer).GetEvents(m, &grpc.GenericServerStream[GetEventsRequest, GetEventsResponse]{ServerStream: stream}) } -type GrpcGateway_GetEventsServer interface { - Send(*GetEventsResponse) error - grpc.ServerStream -} - -type grpcGatewayGetEventsServer struct { - grpc.ServerStream -} - -func (x *grpcGatewayGetEventsServer) Send(m *GetEventsResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type GrpcGateway_GetEventsServer = grpc.ServerStreamingServer[GetEventsResponse] // GrpcGateway_ServiceDesc is the grpc.ServiceDesc for GrpcGateway service. // It's only intended for direct use with grpc.RegisterService, diff --git a/grpc-gateway/pb/updateDeviceMetadata.pb.go b/grpc-gateway/pb/updateDeviceMetadata.pb.go index d63b18787..c350e9031 100644 --- a/grpc-gateway/pb/updateDeviceMetadata.pb.go +++ b/grpc-gateway/pb/updateDeviceMetadata.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: grpc-gateway/pb/updateDeviceMetadata.proto package pb @@ -185,7 +185,7 @@ func file_grpc_gateway_pb_updateDeviceMetadata_proto_rawDescGZIP() []byte { } var file_grpc_gateway_pb_updateDeviceMetadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_grpc_gateway_pb_updateDeviceMetadata_proto_goTypes = []interface{}{ +var file_grpc_gateway_pb_updateDeviceMetadata_proto_goTypes = []any{ (*UpdateDeviceMetadataRequest)(nil), // 0: grpcgateway.pb.UpdateDeviceMetadataRequest (*UpdateDeviceMetadataResponse)(nil), // 1: grpcgateway.pb.UpdateDeviceMetadataResponse (*events.DeviceMetadataUpdated)(nil), // 2: resourceaggregate.pb.DeviceMetadataUpdated @@ -205,7 +205,7 @@ func file_grpc_gateway_pb_updateDeviceMetadata_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_grpc_gateway_pb_updateDeviceMetadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_updateDeviceMetadata_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*UpdateDeviceMetadataRequest); i { case 0: return &v.state @@ -217,7 +217,7 @@ func file_grpc_gateway_pb_updateDeviceMetadata_proto_init() { return nil } } - file_grpc_gateway_pb_updateDeviceMetadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_grpc_gateway_pb_updateDeviceMetadata_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*UpdateDeviceMetadataResponse); i { case 0: return &v.state diff --git a/identity-store/events/events.pb.go b/identity-store/events/events.pb.go index 517181492..e9262a0b7 100644 --- a/identity-store/events/events.pb.go +++ b/identity-store/events/events.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: identity-store/pb/events.proto package events @@ -475,7 +475,7 @@ func file_identity_store_pb_events_proto_rawDescGZIP() []byte { } var file_identity_store_pb_events_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_identity_store_pb_events_proto_goTypes = []interface{}{ +var file_identity_store_pb_events_proto_goTypes = []any{ (*AuditContext)(nil), // 0: identitystore.pb.AuditContext (*EventMetadata)(nil), // 1: identitystore.pb.EventMetadata (*DevicesRegistered)(nil), // 2: identitystore.pb.DevicesRegistered @@ -506,7 +506,7 @@ func file_identity_store_pb_events_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_identity_store_pb_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_events_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*AuditContext); i { case 0: return &v.state @@ -518,7 +518,7 @@ func file_identity_store_pb_events_proto_init() { return nil } } - file_identity_store_pb_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_events_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*EventMetadata); i { case 0: return &v.state @@ -530,7 +530,7 @@ func file_identity_store_pb_events_proto_init() { return nil } } - file_identity_store_pb_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_events_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*DevicesRegistered); i { case 0: return &v.state @@ -542,7 +542,7 @@ func file_identity_store_pb_events_proto_init() { return nil } } - file_identity_store_pb_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_events_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*DevicesUnregistered); i { case 0: return &v.state @@ -554,7 +554,7 @@ func file_identity_store_pb_events_proto_init() { return nil } } - file_identity_store_pb_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_events_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*Event); i { case 0: return &v.state @@ -567,7 +567,7 @@ func file_identity_store_pb_events_proto_init() { } } } - file_identity_store_pb_events_proto_msgTypes[4].OneofWrappers = []interface{}{ + file_identity_store_pb_events_proto_msgTypes[4].OneofWrappers = []any{ (*Event_DevicesRegistered)(nil), (*Event_DevicesUnregistered)(nil), } diff --git a/identity-store/pb/devices.pb.go b/identity-store/pb/devices.pb.go index 3b1e1c31b..9d4f5b9da 100644 --- a/identity-store/pb/devices.pb.go +++ b/identity-store/pb/devices.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: identity-store/pb/devices.proto package pb @@ -336,7 +336,7 @@ func file_identity_store_pb_devices_proto_rawDescGZIP() []byte { } var file_identity_store_pb_devices_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_identity_store_pb_devices_proto_goTypes = []interface{}{ +var file_identity_store_pb_devices_proto_goTypes = []any{ (*GetDevicesRequest)(nil), // 0: identitystore.pb.GetDevicesRequest (*Device)(nil), // 1: identitystore.pb.Device (*AddDeviceRequest)(nil), // 2: identitystore.pb.AddDeviceRequest @@ -358,7 +358,7 @@ func file_identity_store_pb_devices_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_identity_store_pb_devices_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_devices_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GetDevicesRequest); i { case 0: return &v.state @@ -370,7 +370,7 @@ func file_identity_store_pb_devices_proto_init() { return nil } } - file_identity_store_pb_devices_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_devices_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Device); i { case 0: return &v.state @@ -382,7 +382,7 @@ func file_identity_store_pb_devices_proto_init() { return nil } } - file_identity_store_pb_devices_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_devices_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*AddDeviceRequest); i { case 0: return &v.state @@ -394,7 +394,7 @@ func file_identity_store_pb_devices_proto_init() { return nil } } - file_identity_store_pb_devices_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_devices_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*AddDeviceResponse); i { case 0: return &v.state @@ -406,7 +406,7 @@ func file_identity_store_pb_devices_proto_init() { return nil } } - file_identity_store_pb_devices_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_devices_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*DeleteDevicesRequest); i { case 0: return &v.state @@ -418,7 +418,7 @@ func file_identity_store_pb_devices_proto_init() { return nil } } - file_identity_store_pb_devices_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_identity_store_pb_devices_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*DeleteDevicesResponse); i { case 0: return &v.state diff --git a/identity-store/pb/service.pb.go b/identity-store/pb/service.pb.go index 20af79403..46d743d74 100644 --- a/identity-store/pb/service.pb.go +++ b/identity-store/pb/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: identity-store/pb/service.proto package pb @@ -51,7 +51,7 @@ var file_identity_store_pb_service_proto_rawDesc = []byte{ 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_identity_store_pb_service_proto_goTypes = []interface{}{ +var file_identity_store_pb_service_proto_goTypes = []any{ (*GetDevicesRequest)(nil), // 0: identitystore.pb.GetDevicesRequest (*AddDeviceRequest)(nil), // 1: identitystore.pb.AddDeviceRequest (*DeleteDevicesRequest)(nil), // 2: identitystore.pb.DeleteDevicesRequest diff --git a/identity-store/pb/service_grpc.pb.go b/identity-store/pb/service_grpc.pb.go index af1f50d9f..81fdd6d67 100644 --- a/identity-store/pb/service_grpc.pb.go +++ b/identity-store/pb/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: identity-store/pb/service.proto package pb @@ -15,8 +15,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( IdentityStore_GetDevices_FullMethodName = "/identitystore.pb.IdentityStore/GetDevices" @@ -28,7 +28,7 @@ const ( // // 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 IdentityStoreClient interface { - GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (IdentityStore_GetDevicesClient, error) + GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Device], error) AddDevice(ctx context.Context, in *AddDeviceRequest, opts ...grpc.CallOption) (*AddDeviceResponse, error) DeleteDevices(ctx context.Context, in *DeleteDevicesRequest, opts ...grpc.CallOption) (*DeleteDevicesResponse, error) } @@ -41,12 +41,13 @@ func NewIdentityStoreClient(cc grpc.ClientConnInterface) IdentityStoreClient { return &identityStoreClient{cc} } -func (c *identityStoreClient) GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (IdentityStore_GetDevicesClient, error) { - stream, err := c.cc.NewStream(ctx, &IdentityStore_ServiceDesc.Streams[0], IdentityStore_GetDevices_FullMethodName, opts...) +func (c *identityStoreClient) GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Device], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &IdentityStore_ServiceDesc.Streams[0], IdentityStore_GetDevices_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &identityStoreGetDevicesClient{stream} + x := &grpc.GenericClientStream[GetDevicesRequest, Device]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -56,26 +57,13 @@ func (c *identityStoreClient) GetDevices(ctx context.Context, in *GetDevicesRequ return x, nil } -type IdentityStore_GetDevicesClient interface { - Recv() (*Device, error) - grpc.ClientStream -} - -type identityStoreGetDevicesClient struct { - grpc.ClientStream -} - -func (x *identityStoreGetDevicesClient) Recv() (*Device, error) { - m := new(Device) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type IdentityStore_GetDevicesClient = grpc.ServerStreamingClient[Device] func (c *identityStoreClient) AddDevice(ctx context.Context, in *AddDeviceRequest, opts ...grpc.CallOption) (*AddDeviceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddDeviceResponse) - err := c.cc.Invoke(ctx, IdentityStore_AddDevice_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, IdentityStore_AddDevice_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +71,9 @@ func (c *identityStoreClient) AddDevice(ctx context.Context, in *AddDeviceReques } func (c *identityStoreClient) DeleteDevices(ctx context.Context, in *DeleteDevicesRequest, opts ...grpc.CallOption) (*DeleteDevicesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteDevicesResponse) - err := c.cc.Invoke(ctx, IdentityStore_DeleteDevices_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, IdentityStore_DeleteDevices_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -93,19 +82,22 @@ func (c *identityStoreClient) DeleteDevices(ctx context.Context, in *DeleteDevic // IdentityStoreServer is the server API for IdentityStore service. // All implementations must embed UnimplementedIdentityStoreServer -// for forward compatibility +// for forward compatibility. type IdentityStoreServer interface { - GetDevices(*GetDevicesRequest, IdentityStore_GetDevicesServer) error + GetDevices(*GetDevicesRequest, grpc.ServerStreamingServer[Device]) error AddDevice(context.Context, *AddDeviceRequest) (*AddDeviceResponse, error) DeleteDevices(context.Context, *DeleteDevicesRequest) (*DeleteDevicesResponse, error) mustEmbedUnimplementedIdentityStoreServer() } -// UnimplementedIdentityStoreServer must be embedded to have forward compatible implementations. -type UnimplementedIdentityStoreServer struct { -} +// UnimplementedIdentityStoreServer 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 UnimplementedIdentityStoreServer struct{} -func (UnimplementedIdentityStoreServer) GetDevices(*GetDevicesRequest, IdentityStore_GetDevicesServer) error { +func (UnimplementedIdentityStoreServer) GetDevices(*GetDevicesRequest, grpc.ServerStreamingServer[Device]) error { return status.Errorf(codes.Unimplemented, "method GetDevices not implemented") } func (UnimplementedIdentityStoreServer) AddDevice(context.Context, *AddDeviceRequest) (*AddDeviceResponse, error) { @@ -115,6 +107,7 @@ func (UnimplementedIdentityStoreServer) DeleteDevices(context.Context, *DeleteDe return nil, status.Errorf(codes.Unimplemented, "method DeleteDevices not implemented") } func (UnimplementedIdentityStoreServer) mustEmbedUnimplementedIdentityStoreServer() {} +func (UnimplementedIdentityStoreServer) testEmbeddedByValue() {} // UnsafeIdentityStoreServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to IdentityStoreServer will @@ -124,6 +117,13 @@ type UnsafeIdentityStoreServer interface { } func RegisterIdentityStoreServer(s grpc.ServiceRegistrar, srv IdentityStoreServer) { + // If the following call pancis, it indicates UnimplementedIdentityStoreServer 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() + } s.RegisterService(&IdentityStore_ServiceDesc, srv) } @@ -132,21 +132,11 @@ func _IdentityStore_GetDevices_Handler(srv interface{}, stream grpc.ServerStream if err := stream.RecvMsg(m); err != nil { return err } - return srv.(IdentityStoreServer).GetDevices(m, &identityStoreGetDevicesServer{stream}) -} - -type IdentityStore_GetDevicesServer interface { - Send(*Device) error - grpc.ServerStream + return srv.(IdentityStoreServer).GetDevices(m, &grpc.GenericServerStream[GetDevicesRequest, Device]{ServerStream: stream}) } -type identityStoreGetDevicesServer struct { - grpc.ServerStream -} - -func (x *identityStoreGetDevicesServer) Send(m *Device) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type IdentityStore_GetDevicesServer = grpc.ServerStreamingServer[Device] func _IdentityStore_AddDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddDeviceRequest) diff --git a/m2m-oauth-server/pb/service.pb.go b/m2m-oauth-server/pb/service.pb.go index 5a2b643ff..1876d886c 100644 --- a/m2m-oauth-server/pb/service.pb.go +++ b/m2m-oauth-server/pb/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: m2m-oauth-server/pb/service.proto package pb @@ -729,7 +729,7 @@ func file_m2m_oauth_server_pb_service_proto_rawDescGZIP() []byte { } var file_m2m_oauth_server_pb_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_m2m_oauth_server_pb_service_proto_goTypes = []interface{}{ +var file_m2m_oauth_server_pb_service_proto_goTypes = []any{ (*Token)(nil), // 0: m2moauthserver.pb.Token (*GetTokensRequest)(nil), // 1: m2moauthserver.pb.GetTokensRequest (*DeleteTokensRequest)(nil), // 2: m2moauthserver.pb.DeleteTokensRequest @@ -761,7 +761,7 @@ func file_m2m_oauth_server_pb_service_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_m2m_oauth_server_pb_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_m2m_oauth_server_pb_service_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Token); i { case 0: return &v.state @@ -773,7 +773,7 @@ func file_m2m_oauth_server_pb_service_proto_init() { return nil } } - file_m2m_oauth_server_pb_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_m2m_oauth_server_pb_service_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*GetTokensRequest); i { case 0: return &v.state @@ -785,7 +785,7 @@ func file_m2m_oauth_server_pb_service_proto_init() { return nil } } - file_m2m_oauth_server_pb_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_m2m_oauth_server_pb_service_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*DeleteTokensRequest); i { case 0: return &v.state @@ -797,7 +797,7 @@ func file_m2m_oauth_server_pb_service_proto_init() { return nil } } - file_m2m_oauth_server_pb_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_m2m_oauth_server_pb_service_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*DeleteTokensResponse); i { case 0: return &v.state @@ -809,7 +809,7 @@ func file_m2m_oauth_server_pb_service_proto_init() { return nil } } - file_m2m_oauth_server_pb_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_m2m_oauth_server_pb_service_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*CreateTokenRequest); i { case 0: return &v.state @@ -821,7 +821,7 @@ func file_m2m_oauth_server_pb_service_proto_init() { return nil } } - file_m2m_oauth_server_pb_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_m2m_oauth_server_pb_service_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*CreateTokenResponse); i { case 0: return &v.state @@ -833,7 +833,7 @@ func file_m2m_oauth_server_pb_service_proto_init() { return nil } } - file_m2m_oauth_server_pb_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_m2m_oauth_server_pb_service_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*Token_BlackListed); i { case 0: return &v.state diff --git a/m2m-oauth-server/pb/service.pb.gw.go b/m2m-oauth-server/pb/service.pb.gw.go index 19351e55a..904bf7a7f 100644 --- a/m2m-oauth-server/pb/service.pb.gw.go +++ b/m2m-oauth-server/pb/service.pb.gw.go @@ -125,6 +125,7 @@ func local_request_M2MOAuthService_DeleteTokens_0(ctx context.Context, marshaler // UnaryRPC :call M2MOAuthServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterM2MOAuthServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterM2MOAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server M2MOAuthServiceServer) error { mux.Handle("POST", pattern_M2MOAuthService_CreateToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -222,7 +223,7 @@ func RegisterM2MOAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "M2MOAuthServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "M2MOAuthServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "M2MOAuthServiceClient" to call the correct interceptors. +// "M2MOAuthServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterM2MOAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client M2MOAuthServiceClient) error { mux.Handle("POST", pattern_M2MOAuthService_CreateToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { diff --git a/m2m-oauth-server/pb/service_grpc.pb.go b/m2m-oauth-server/pb/service_grpc.pb.go index b6dc10ad5..02223aaff 100644 --- a/m2m-oauth-server/pb/service_grpc.pb.go +++ b/m2m-oauth-server/pb/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: m2m-oauth-server/pb/service.proto package pb @@ -15,8 +15,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( M2MOAuthService_CreateToken_FullMethodName = "/m2moauthserver.pb.M2MOAuthService/CreateToken" @@ -31,7 +31,7 @@ type M2MOAuthServiceClient interface { // Creates a new token CreateToken(ctx context.Context, in *CreateTokenRequest, opts ...grpc.CallOption) (*CreateTokenResponse, error) // Returns all tokens of the owner - GetTokens(ctx context.Context, in *GetTokensRequest, opts ...grpc.CallOption) (M2MOAuthService_GetTokensClient, error) + GetTokens(ctx context.Context, in *GetTokensRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Token], error) // Deletes/blacklist tokens DeleteTokens(ctx context.Context, in *DeleteTokensRequest, opts ...grpc.CallOption) (*DeleteTokensResponse, error) } @@ -45,20 +45,22 @@ func NewM2MOAuthServiceClient(cc grpc.ClientConnInterface) M2MOAuthServiceClient } func (c *m2MOAuthServiceClient) CreateToken(ctx context.Context, in *CreateTokenRequest, opts ...grpc.CallOption) (*CreateTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CreateTokenResponse) - err := c.cc.Invoke(ctx, M2MOAuthService_CreateToken_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, M2MOAuthService_CreateToken_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *m2MOAuthServiceClient) GetTokens(ctx context.Context, in *GetTokensRequest, opts ...grpc.CallOption) (M2MOAuthService_GetTokensClient, error) { - stream, err := c.cc.NewStream(ctx, &M2MOAuthService_ServiceDesc.Streams[0], M2MOAuthService_GetTokens_FullMethodName, opts...) +func (c *m2MOAuthServiceClient) GetTokens(ctx context.Context, in *GetTokensRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Token], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &M2MOAuthService_ServiceDesc.Streams[0], M2MOAuthService_GetTokens_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &m2MOAuthServiceGetTokensClient{stream} + x := &grpc.GenericClientStream[GetTokensRequest, Token]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -68,26 +70,13 @@ func (c *m2MOAuthServiceClient) GetTokens(ctx context.Context, in *GetTokensRequ return x, nil } -type M2MOAuthService_GetTokensClient interface { - Recv() (*Token, error) - grpc.ClientStream -} - -type m2MOAuthServiceGetTokensClient struct { - grpc.ClientStream -} - -func (x *m2MOAuthServiceGetTokensClient) Recv() (*Token, error) { - m := new(Token) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type M2MOAuthService_GetTokensClient = grpc.ServerStreamingClient[Token] func (c *m2MOAuthServiceClient) DeleteTokens(ctx context.Context, in *DeleteTokensRequest, opts ...grpc.CallOption) (*DeleteTokensResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteTokensResponse) - err := c.cc.Invoke(ctx, M2MOAuthService_DeleteTokens_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, M2MOAuthService_DeleteTokens_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -96,31 +85,35 @@ func (c *m2MOAuthServiceClient) DeleteTokens(ctx context.Context, in *DeleteToke // M2MOAuthServiceServer is the server API for M2MOAuthService service. // All implementations must embed UnimplementedM2MOAuthServiceServer -// for forward compatibility +// for forward compatibility. type M2MOAuthServiceServer interface { // Creates a new token CreateToken(context.Context, *CreateTokenRequest) (*CreateTokenResponse, error) // Returns all tokens of the owner - GetTokens(*GetTokensRequest, M2MOAuthService_GetTokensServer) error + GetTokens(*GetTokensRequest, grpc.ServerStreamingServer[Token]) error // Deletes/blacklist tokens DeleteTokens(context.Context, *DeleteTokensRequest) (*DeleteTokensResponse, error) mustEmbedUnimplementedM2MOAuthServiceServer() } -// UnimplementedM2MOAuthServiceServer must be embedded to have forward compatible implementations. -type UnimplementedM2MOAuthServiceServer struct { -} +// UnimplementedM2MOAuthServiceServer 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 UnimplementedM2MOAuthServiceServer struct{} func (UnimplementedM2MOAuthServiceServer) CreateToken(context.Context, *CreateTokenRequest) (*CreateTokenResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateToken not implemented") } -func (UnimplementedM2MOAuthServiceServer) GetTokens(*GetTokensRequest, M2MOAuthService_GetTokensServer) error { +func (UnimplementedM2MOAuthServiceServer) GetTokens(*GetTokensRequest, grpc.ServerStreamingServer[Token]) error { return status.Errorf(codes.Unimplemented, "method GetTokens not implemented") } func (UnimplementedM2MOAuthServiceServer) DeleteTokens(context.Context, *DeleteTokensRequest) (*DeleteTokensResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteTokens not implemented") } func (UnimplementedM2MOAuthServiceServer) mustEmbedUnimplementedM2MOAuthServiceServer() {} +func (UnimplementedM2MOAuthServiceServer) testEmbeddedByValue() {} // UnsafeM2MOAuthServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to M2MOAuthServiceServer will @@ -130,6 +123,13 @@ type UnsafeM2MOAuthServiceServer interface { } func RegisterM2MOAuthServiceServer(s grpc.ServiceRegistrar, srv M2MOAuthServiceServer) { + // If the following call pancis, it indicates UnimplementedM2MOAuthServiceServer 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() + } s.RegisterService(&M2MOAuthService_ServiceDesc, srv) } @@ -156,21 +156,11 @@ func _M2MOAuthService_GetTokens_Handler(srv interface{}, stream grpc.ServerStrea if err := stream.RecvMsg(m); err != nil { return err } - return srv.(M2MOAuthServiceServer).GetTokens(m, &m2MOAuthServiceGetTokensServer{stream}) -} - -type M2MOAuthService_GetTokensServer interface { - Send(*Token) error - grpc.ServerStream + return srv.(M2MOAuthServiceServer).GetTokens(m, &grpc.GenericServerStream[GetTokensRequest, Token]{ServerStream: stream}) } -type m2MOAuthServiceGetTokensServer struct { - grpc.ServerStream -} - -func (x *m2MOAuthServiceGetTokensServer) Send(m *Token) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type M2MOAuthService_GetTokensServer = grpc.ServerStreamingServer[Token] func _M2MOAuthService_DeleteTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteTokensRequest) diff --git a/pkg/net/grpc/stub.pb_test.go b/pkg/net/grpc/stub.pb_test.go index 01c8ddcc3..7abe50dc7 100644 --- a/pkg/net/grpc/stub.pb_test.go +++ b/pkg/net/grpc/stub.pb_test.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: github.com/plgd-dev/hub/pkg/net/grpc/stub.proto package grpc_test @@ -157,7 +157,7 @@ func file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_rawDescGZIP() []byte { } var file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_goTypes = []interface{}{ +var file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_goTypes = []any{ (*TestRequest)(nil), // 0: pkg.net.grpc.server.TestRequest (*TestResponse)(nil), // 1: pkg.net.grpc.server.TestResponse } @@ -179,7 +179,7 @@ func file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*TestRequest); i { case 0: return &v.state @@ -191,7 +191,7 @@ func file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_init() { return nil } } - file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_github_com_plgd_dev_hub_pkg_net_grpc_stub_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*TestResponse); i { case 0: return &v.state diff --git a/pkg/net/grpc/stub_grpc.pb_test.go b/pkg/net/grpc/stub_grpc.pb_test.go index 4092c7941..a895bcf53 100644 --- a/pkg/net/grpc/stub_grpc.pb_test.go +++ b/pkg/net/grpc/stub_grpc.pb_test.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: github.com/plgd-dev/hub/pkg/net/grpc/stub.proto package grpc_test @@ -15,8 +15,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( StubService_TestCall_FullMethodName = "/pkg.net.grpc.server.StubService/TestCall" @@ -28,7 +28,7 @@ const ( // 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 StubServiceClient interface { TestCall(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) - TestStream(ctx context.Context, opts ...grpc.CallOption) (StubService_TestStreamClient, error) + TestStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[TestRequest, TestResponse], error) } type stubServiceClient struct { @@ -40,65 +40,52 @@ func NewStubServiceClient(cc grpc.ClientConnInterface) StubServiceClient { } func (c *stubServiceClient) TestCall(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TestResponse) - err := c.cc.Invoke(ctx, StubService_TestCall_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, StubService_TestCall_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *stubServiceClient) TestStream(ctx context.Context, opts ...grpc.CallOption) (StubService_TestStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StubService_ServiceDesc.Streams[0], StubService_TestStream_FullMethodName, opts...) +func (c *stubServiceClient) TestStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[TestRequest, TestResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StubService_ServiceDesc.Streams[0], StubService_TestStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &stubServiceTestStreamClient{stream} + x := &grpc.GenericClientStream[TestRequest, TestResponse]{ClientStream: stream} return x, nil } -type StubService_TestStreamClient interface { - Send(*TestRequest) error - Recv() (*TestResponse, error) - grpc.ClientStream -} - -type stubServiceTestStreamClient struct { - grpc.ClientStream -} - -func (x *stubServiceTestStreamClient) Send(m *TestRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *stubServiceTestStreamClient) Recv() (*TestResponse, error) { - m := new(TestResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StubService_TestStreamClient = grpc.BidiStreamingClient[TestRequest, TestResponse] // StubServiceServer is the server API for StubService service. // All implementations must embed UnimplementedStubServiceServer -// for forward compatibility +// for forward compatibility. type StubServiceServer interface { TestCall(context.Context, *TestRequest) (*TestResponse, error) - TestStream(StubService_TestStreamServer) error + TestStream(grpc.BidiStreamingServer[TestRequest, TestResponse]) error mustEmbedUnimplementedStubServiceServer() } -// UnimplementedStubServiceServer must be embedded to have forward compatible implementations. -type UnimplementedStubServiceServer struct { -} +// UnimplementedStubServiceServer 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 UnimplementedStubServiceServer struct{} func (UnimplementedStubServiceServer) TestCall(context.Context, *TestRequest) (*TestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TestCall not implemented") } -func (UnimplementedStubServiceServer) TestStream(StubService_TestStreamServer) error { +func (UnimplementedStubServiceServer) TestStream(grpc.BidiStreamingServer[TestRequest, TestResponse]) error { return status.Errorf(codes.Unimplemented, "method TestStream not implemented") } func (UnimplementedStubServiceServer) mustEmbedUnimplementedStubServiceServer() {} +func (UnimplementedStubServiceServer) testEmbeddedByValue() {} // UnsafeStubServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StubServiceServer will @@ -108,6 +95,13 @@ type UnsafeStubServiceServer interface { } func RegisterStubServiceServer(s grpc.ServiceRegistrar, srv StubServiceServer) { + // If the following call pancis, it indicates UnimplementedStubServiceServer 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() + } s.RegisterService(&StubService_ServiceDesc, srv) } @@ -130,30 +124,11 @@ func _StubService_TestCall_Handler(srv interface{}, ctx context.Context, dec fun } func _StubService_TestStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StubServiceServer).TestStream(&stubServiceTestStreamServer{stream}) -} - -type StubService_TestStreamServer interface { - Send(*TestResponse) error - Recv() (*TestRequest, error) - grpc.ServerStream -} - -type stubServiceTestStreamServer struct { - grpc.ServerStream + return srv.(StubServiceServer).TestStream(&grpc.GenericServerStream[TestRequest, TestResponse]{ServerStream: stream}) } -func (x *stubServiceTestStreamServer) Send(m *TestResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *stubServiceTestStreamServer) Recv() (*TestRequest, error) { - m := new(TestRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StubService_TestStreamServer = grpc.BidiStreamingServer[TestRequest, TestResponse] // StubService_ServiceDesc is the grpc.ServiceDesc for StubService service. // It's only intended for direct use with grpc.RegisterService, diff --git a/resource-aggregate/commands/commands.pb.go b/resource-aggregate/commands/commands.pb.go index 8b6a0ee9d..ba24141a8 100644 --- a/resource-aggregate/commands/commands.pb.go +++ b/resource-aggregate/commands/commands.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-aggregate/pb/commands.proto package commands @@ -3422,7 +3422,7 @@ func file_resource_aggregate_pb_commands_proto_rawDescGZIP() []byte { var file_resource_aggregate_pb_commands_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_resource_aggregate_pb_commands_proto_msgTypes = make([]protoimpl.MessageInfo, 40) -var file_resource_aggregate_pb_commands_proto_goTypes = []interface{}{ +var file_resource_aggregate_pb_commands_proto_goTypes = []any{ (Connection_Status)(0), // 0: resourceaggregate.pb.Connection.Status (Connection_Protocol)(0), // 1: resourceaggregate.pb.Connection.Protocol (TwinSynchronization_State)(0), // 2: resourceaggregate.pb.TwinSynchronization.State @@ -3552,7 +3552,7 @@ func file_resource_aggregate_pb_commands_proto_init() { } file_resource_aggregate_pb_resources_proto_init() if !protoimpl.UnsafeEnabled { - file_resource_aggregate_pb_commands_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*CommandMetadata); i { case 0: return &v.state @@ -3564,7 +3564,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*PublishResourceLinksRequest); i { case 0: return &v.state @@ -3576,7 +3576,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*PublishResourceLinksResponse); i { case 0: return &v.state @@ -3588,7 +3588,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*UnpublishResourceLinksRequest); i { case 0: return &v.state @@ -3600,7 +3600,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*UnpublishResourceLinksResponse); i { case 0: return &v.state @@ -3612,7 +3612,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*NotifyResourceChangedRequest); i { case 0: return &v.state @@ -3624,7 +3624,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*NotifyResourceChangedResponse); i { case 0: return &v.state @@ -3636,7 +3636,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*BatchNotifyResourceChangedRequest); i { case 0: return &v.state @@ -3648,7 +3648,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*BatchNotifyResourceChangedResponse); i { case 0: return &v.state @@ -3660,7 +3660,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*UpdateResourceRequest); i { case 0: return &v.state @@ -3672,7 +3672,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*UpdateResourceResponse); i { case 0: return &v.state @@ -3684,7 +3684,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceUpdateRequest); i { case 0: return &v.state @@ -3696,7 +3696,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceUpdateResponse); i { case 0: return &v.state @@ -3708,7 +3708,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*RetrieveResourceRequest); i { case 0: return &v.state @@ -3720,7 +3720,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*RetrieveResourceResponse); i { case 0: return &v.state @@ -3732,7 +3732,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceRetrieveRequest); i { case 0: return &v.state @@ -3744,7 +3744,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceRetrieveResponse); i { case 0: return &v.state @@ -3756,7 +3756,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*DeleteResourceRequest); i { case 0: return &v.state @@ -3768,7 +3768,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*DeleteResourceResponse); i { case 0: return &v.state @@ -3780,7 +3780,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceDeleteRequest); i { case 0: return &v.state @@ -3792,7 +3792,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceDeleteResponse); i { case 0: return &v.state @@ -3804,7 +3804,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*CreateResourceRequest); i { case 0: return &v.state @@ -3816,7 +3816,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*CreateResourceResponse); i { case 0: return &v.state @@ -3828,7 +3828,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceCreateRequest); i { case 0: return &v.state @@ -3840,7 +3840,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*ConfirmResourceCreateResponse); i { case 0: return &v.state @@ -3852,7 +3852,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*Connection); i { case 0: return &v.state @@ -3864,7 +3864,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[26].Exporter = func(v any, i int) any { switch v := v.(*TwinSynchronization); i { case 0: return &v.state @@ -3876,7 +3876,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[27].Exporter = func(v any, i int) any { switch v := v.(*UpdateDeviceMetadataRequest); i { case 0: return &v.state @@ -3888,7 +3888,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[28].Exporter = func(v any, i int) any { switch v := v.(*UpdateDeviceMetadataResponse); i { case 0: return &v.state @@ -3900,7 +3900,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[29].Exporter = func(v any, i int) any { switch v := v.(*ConfirmDeviceMetadataUpdateRequest); i { case 0: return &v.state @@ -3912,7 +3912,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[30].Exporter = func(v any, i int) any { switch v := v.(*ConfirmDeviceMetadataUpdateResponse); i { case 0: return &v.state @@ -3924,7 +3924,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[31].Exporter = func(v any, i int) any { switch v := v.(*CancelPendingCommandsRequest); i { case 0: return &v.state @@ -3936,7 +3936,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[32].Exporter = func(v any, i int) any { switch v := v.(*CancelPendingCommandsResponse); i { case 0: return &v.state @@ -3948,7 +3948,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[33].Exporter = func(v any, i int) any { switch v := v.(*CancelPendingMetadataUpdatesRequest); i { case 0: return &v.state @@ -3960,7 +3960,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[34].Exporter = func(v any, i int) any { switch v := v.(*CancelPendingMetadataUpdatesResponse); i { case 0: return &v.state @@ -3972,7 +3972,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[35].Exporter = func(v any, i int) any { switch v := v.(*DeleteDevicesRequest); i { case 0: return &v.state @@ -3984,7 +3984,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[36].Exporter = func(v any, i int) any { switch v := v.(*DeleteDevicesResponse); i { case 0: return &v.state @@ -3996,7 +3996,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[37].Exporter = func(v any, i int) any { switch v := v.(*ServiceHeartbeat); i { case 0: return &v.state @@ -4008,7 +4008,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[38].Exporter = func(v any, i int) any { switch v := v.(*UpdateServiceMetadataRequest); i { case 0: return &v.state @@ -4020,7 +4020,7 @@ func file_resource_aggregate_pb_commands_proto_init() { return nil } } - file_resource_aggregate_pb_commands_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_commands_proto_msgTypes[39].Exporter = func(v any, i int) any { switch v := v.(*UpdateServiceMetadataResponse); i { case 0: return &v.state @@ -4033,17 +4033,17 @@ func file_resource_aggregate_pb_commands_proto_init() { } } } - file_resource_aggregate_pb_commands_proto_msgTypes[27].OneofWrappers = []interface{}{ + file_resource_aggregate_pb_commands_proto_msgTypes[27].OneofWrappers = []any{ (*UpdateDeviceMetadataRequest_Connection)(nil), (*UpdateDeviceMetadataRequest_TwinSynchronization)(nil), (*UpdateDeviceMetadataRequest_TwinEnabled)(nil), (*UpdateDeviceMetadataRequest_TwinForceSynchronization)(nil), } - file_resource_aggregate_pb_commands_proto_msgTypes[29].OneofWrappers = []interface{}{ + file_resource_aggregate_pb_commands_proto_msgTypes[29].OneofWrappers = []any{ (*ConfirmDeviceMetadataUpdateRequest_TwinEnabled)(nil), (*ConfirmDeviceMetadataUpdateRequest_TwinForceSynchronization)(nil), } - file_resource_aggregate_pb_commands_proto_msgTypes[38].OneofWrappers = []interface{}{ + file_resource_aggregate_pb_commands_proto_msgTypes[38].OneofWrappers = []any{ (*UpdateServiceMetadataRequest_Heartbeat)(nil), } type x struct{} diff --git a/resource-aggregate/commands/resources.pb.go b/resource-aggregate/commands/resources.pb.go index 55b1166be..5217d02c8 100644 --- a/resource-aggregate/commands/resources.pb.go +++ b/resource-aggregate/commands/resources.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-aggregate/pb/resources.proto package commands @@ -598,7 +598,7 @@ func file_resource_aggregate_pb_resources_proto_rawDescGZIP() []byte { var file_resource_aggregate_pb_resources_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_resource_aggregate_pb_resources_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_resource_aggregate_pb_resources_proto_goTypes = []interface{}{ +var file_resource_aggregate_pb_resources_proto_goTypes = []any{ (Status)(0), // 0: resourceaggregate.pb.Status (*AuditContext)(nil), // 1: resourceaggregate.pb.AuditContext (*ResourceId)(nil), // 2: resourceaggregate.pb.ResourceId @@ -623,7 +623,7 @@ func file_resource_aggregate_pb_resources_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_resource_aggregate_pb_resources_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_resources_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*AuditContext); i { case 0: return &v.state @@ -635,7 +635,7 @@ func file_resource_aggregate_pb_resources_proto_init() { return nil } } - file_resource_aggregate_pb_resources_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_resources_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*ResourceId); i { case 0: return &v.state @@ -647,7 +647,7 @@ func file_resource_aggregate_pb_resources_proto_init() { return nil } } - file_resource_aggregate_pb_resources_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_resources_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*Resource); i { case 0: return &v.state @@ -659,7 +659,7 @@ func file_resource_aggregate_pb_resources_proto_init() { return nil } } - file_resource_aggregate_pb_resources_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_resources_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*Policy); i { case 0: return &v.state @@ -671,7 +671,7 @@ func file_resource_aggregate_pb_resources_proto_init() { return nil } } - file_resource_aggregate_pb_resources_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_resources_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*Content); i { case 0: return &v.state @@ -683,7 +683,7 @@ func file_resource_aggregate_pb_resources_proto_init() { return nil } } - file_resource_aggregate_pb_resources_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_resources_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*EndpointInformation); i { case 0: return &v.state diff --git a/resource-aggregate/cqrs/aggregate/test/aggregate_test.pb.go b/resource-aggregate/cqrs/aggregate/test/aggregate_test.pb.go index 6edc3af42..0c181453c 100644 --- a/resource-aggregate/cqrs/aggregate/test/aggregate_test.pb.go +++ b/resource-aggregate/cqrs/aggregate/test/aggregate_test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-aggregate/cqrs/aggregate/test/aggregate_test.proto package test @@ -418,7 +418,7 @@ func file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_rawDescGZI } var file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_goTypes = []interface{}{ +var file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_goTypes = []any{ (*Publish)(nil), // 0: ocf.cloud.resourceaggregate.cqrs.aggregate.test.v2.Publish (*Unpublish)(nil), // 1: ocf.cloud.resourceaggregate.cqrs.aggregate.test.v2.Unpublish (*Published)(nil), // 2: ocf.cloud.resourceaggregate.cqrs.aggregate.test.v2.Published @@ -439,7 +439,7 @@ func file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Publish); i { case 0: return &v.state @@ -451,7 +451,7 @@ func file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_init() { return nil } } - file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Unpublish); i { case 0: return &v.state @@ -463,7 +463,7 @@ func file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_init() { return nil } } - file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*Published); i { case 0: return &v.state @@ -475,7 +475,7 @@ func file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_init() { return nil } } - file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*Unpublished); i { case 0: return &v.state @@ -487,7 +487,7 @@ func file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_init() { return nil } } - file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_cqrs_aggregate_test_aggregate_test_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*Snapshot); i { case 0: return &v.state diff --git a/resource-aggregate/cqrs/eventbus/pb/eventbus.pb.go b/resource-aggregate/cqrs/eventbus/pb/eventbus.pb.go index 33018250f..91807d159 100644 --- a/resource-aggregate/cqrs/eventbus/pb/eventbus.pb.go +++ b/resource-aggregate/cqrs/eventbus/pb/eventbus.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-aggregate/cqrs/eventbus/pb/eventbus.proto package pb @@ -157,7 +157,7 @@ func file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_rawDescGZIP() []byt } var file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_goTypes = []interface{}{ +var file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_goTypes = []any{ (*Event)(nil), // 0: ocf.cloud.cqrs.eventbus.v2.Event } var file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_depIdxs = []int32{ @@ -174,7 +174,7 @@ func file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_cqrs_eventbus_pb_eventbus_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Event); i { case 0: return &v.state diff --git a/resource-aggregate/events/events.pb.go b/resource-aggregate/events/events.pb.go index 4ffd3be2d..c6d2583dc 100644 --- a/resource-aggregate/events/events.pb.go +++ b/resource-aggregate/events/events.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-aggregate/pb/events.proto package events @@ -2530,7 +2530,7 @@ func file_resource_aggregate_pb_events_proto_rawDescGZIP() []byte { } var file_resource_aggregate_pb_events_proto_msgTypes = make([]protoimpl.MessageInfo, 36) -var file_resource_aggregate_pb_events_proto_goTypes = []interface{}{ +var file_resource_aggregate_pb_events_proto_goTypes = []any{ (*EventMetadata)(nil), // 0: resourceaggregate.pb.EventMetadata (*ResourceLinksPublished)(nil), // 1: resourceaggregate.pb.ResourceLinksPublished (*ResourceLinksUnpublished)(nil), // 2: resourceaggregate.pb.ResourceLinksUnpublished @@ -2675,7 +2675,7 @@ func file_resource_aggregate_pb_events_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_resource_aggregate_pb_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*EventMetadata); i { case 0: return &v.state @@ -2687,7 +2687,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*ResourceLinksPublished); i { case 0: return &v.state @@ -2699,7 +2699,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*ResourceLinksUnpublished); i { case 0: return &v.state @@ -2711,7 +2711,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*ResourceLinksSnapshotTaken); i { case 0: return &v.state @@ -2723,7 +2723,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*ResourceChanged); i { case 0: return &v.state @@ -2735,7 +2735,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*ResourceUpdatePending); i { case 0: return &v.state @@ -2747,7 +2747,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*ResourceUpdated); i { case 0: return &v.state @@ -2759,7 +2759,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*ResourceRetrievePending); i { case 0: return &v.state @@ -2771,7 +2771,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*ResourceRetrieved); i { case 0: return &v.state @@ -2783,7 +2783,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*ResourceDeletePending); i { case 0: return &v.state @@ -2795,7 +2795,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*ResourceDeleted); i { case 0: return &v.state @@ -2807,7 +2807,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ResourceCreatePending); i { case 0: return &v.state @@ -2819,7 +2819,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*ResourceCreated); i { case 0: return &v.state @@ -2831,7 +2831,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*ResourceStateSnapshotTaken); i { case 0: return &v.state @@ -2843,7 +2843,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*DeviceMetadataUpdated); i { case 0: return &v.state @@ -2855,7 +2855,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*DeviceMetadataUpdatePending); i { case 0: return &v.state @@ -2867,7 +2867,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*DeviceMetadataSnapshotTaken); i { case 0: return &v.state @@ -2879,7 +2879,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*ServicesHeartbeat); i { case 0: return &v.state @@ -2891,7 +2891,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*ServiceMetadataUpdated); i { case 0: return &v.state @@ -2903,7 +2903,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*ServiceMetadataSnapshotTaken); i { case 0: return &v.state @@ -2915,7 +2915,7 @@ func file_resource_aggregate_pb_events_proto_init() { return nil } } - file_resource_aggregate_pb_events_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_resource_aggregate_pb_events_proto_msgTypes[34].Exporter = func(v any, i int) any { switch v := v.(*ServicesHeartbeat_Heartbeat); i { case 0: return &v.state @@ -2928,7 +2928,7 @@ func file_resource_aggregate_pb_events_proto_init() { } } } - file_resource_aggregate_pb_events_proto_msgTypes[15].OneofWrappers = []interface{}{ + file_resource_aggregate_pb_events_proto_msgTypes[15].OneofWrappers = []any{ (*DeviceMetadataUpdatePending_TwinEnabled)(nil), (*DeviceMetadataUpdatePending_TwinForceSynchronization)(nil), } diff --git a/resource-aggregate/service/service.pb.go b/resource-aggregate/service/service.pb.go index b86ad083f..d429a6a3f 100644 --- a/resource-aggregate/service/service.pb.go +++ b/resource-aggregate/service/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-aggregate/pb/service.proto package service @@ -184,7 +184,7 @@ var file_resource_aggregate_pb_service_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var file_resource_aggregate_pb_service_proto_goTypes = []interface{}{ +var file_resource_aggregate_pb_service_proto_goTypes = []any{ (*commands.PublishResourceLinksRequest)(nil), // 0: resourceaggregate.pb.PublishResourceLinksRequest (*commands.UnpublishResourceLinksRequest)(nil), // 1: resourceaggregate.pb.UnpublishResourceLinksRequest (*commands.NotifyResourceChangedRequest)(nil), // 2: resourceaggregate.pb.NotifyResourceChangedRequest diff --git a/resource-aggregate/service/service_grpc.pb.go b/resource-aggregate/service/service_grpc.pb.go index fb6b9f5ef..817b93cdd 100644 --- a/resource-aggregate/service/service_grpc.pb.go +++ b/resource-aggregate/service/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: resource-aggregate/pb/service.proto package service @@ -16,8 +16,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ResourceAggregate_PublishResourceLinks_FullMethodName = "/resourceaggregate.pb.ResourceAggregate/PublishResourceLinks" @@ -75,8 +75,9 @@ func NewResourceAggregateClient(cc grpc.ClientConnInterface) ResourceAggregateCl } func (c *resourceAggregateClient) PublishResourceLinks(ctx context.Context, in *commands.PublishResourceLinksRequest, opts ...grpc.CallOption) (*commands.PublishResourceLinksResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.PublishResourceLinksResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_PublishResourceLinks_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_PublishResourceLinks_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -84,8 +85,9 @@ func (c *resourceAggregateClient) PublishResourceLinks(ctx context.Context, in * } func (c *resourceAggregateClient) UnpublishResourceLinks(ctx context.Context, in *commands.UnpublishResourceLinksRequest, opts ...grpc.CallOption) (*commands.UnpublishResourceLinksResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.UnpublishResourceLinksResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_UnpublishResourceLinks_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_UnpublishResourceLinks_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -93,8 +95,9 @@ func (c *resourceAggregateClient) UnpublishResourceLinks(ctx context.Context, in } func (c *resourceAggregateClient) NotifyResourceChanged(ctx context.Context, in *commands.NotifyResourceChangedRequest, opts ...grpc.CallOption) (*commands.NotifyResourceChangedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.NotifyResourceChangedResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_NotifyResourceChanged_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_NotifyResourceChanged_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -102,8 +105,9 @@ func (c *resourceAggregateClient) NotifyResourceChanged(ctx context.Context, in } func (c *resourceAggregateClient) UpdateResource(ctx context.Context, in *commands.UpdateResourceRequest, opts ...grpc.CallOption) (*commands.UpdateResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.UpdateResourceResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_UpdateResource_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_UpdateResource_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -111,8 +115,9 @@ func (c *resourceAggregateClient) UpdateResource(ctx context.Context, in *comman } func (c *resourceAggregateClient) ConfirmResourceUpdate(ctx context.Context, in *commands.ConfirmResourceUpdateRequest, opts ...grpc.CallOption) (*commands.ConfirmResourceUpdateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.ConfirmResourceUpdateResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceUpdate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceUpdate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -120,8 +125,9 @@ func (c *resourceAggregateClient) ConfirmResourceUpdate(ctx context.Context, in } func (c *resourceAggregateClient) RetrieveResource(ctx context.Context, in *commands.RetrieveResourceRequest, opts ...grpc.CallOption) (*commands.RetrieveResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.RetrieveResourceResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_RetrieveResource_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_RetrieveResource_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -129,8 +135,9 @@ func (c *resourceAggregateClient) RetrieveResource(ctx context.Context, in *comm } func (c *resourceAggregateClient) ConfirmResourceRetrieve(ctx context.Context, in *commands.ConfirmResourceRetrieveRequest, opts ...grpc.CallOption) (*commands.ConfirmResourceRetrieveResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.ConfirmResourceRetrieveResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceRetrieve_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceRetrieve_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -138,8 +145,9 @@ func (c *resourceAggregateClient) ConfirmResourceRetrieve(ctx context.Context, i } func (c *resourceAggregateClient) DeleteResource(ctx context.Context, in *commands.DeleteResourceRequest, opts ...grpc.CallOption) (*commands.DeleteResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.DeleteResourceResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_DeleteResource_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_DeleteResource_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -147,8 +155,9 @@ func (c *resourceAggregateClient) DeleteResource(ctx context.Context, in *comman } func (c *resourceAggregateClient) ConfirmResourceDelete(ctx context.Context, in *commands.ConfirmResourceDeleteRequest, opts ...grpc.CallOption) (*commands.ConfirmResourceDeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.ConfirmResourceDeleteResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceDelete_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceDelete_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -156,8 +165,9 @@ func (c *resourceAggregateClient) ConfirmResourceDelete(ctx context.Context, in } func (c *resourceAggregateClient) CreateResource(ctx context.Context, in *commands.CreateResourceRequest, opts ...grpc.CallOption) (*commands.CreateResourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.CreateResourceResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_CreateResource_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_CreateResource_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -165,8 +175,9 @@ func (c *resourceAggregateClient) CreateResource(ctx context.Context, in *comman } func (c *resourceAggregateClient) ConfirmResourceCreate(ctx context.Context, in *commands.ConfirmResourceCreateRequest, opts ...grpc.CallOption) (*commands.ConfirmResourceCreateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.ConfirmResourceCreateResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceCreate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmResourceCreate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -174,8 +185,9 @@ func (c *resourceAggregateClient) ConfirmResourceCreate(ctx context.Context, in } func (c *resourceAggregateClient) UpdateDeviceMetadata(ctx context.Context, in *commands.UpdateDeviceMetadataRequest, opts ...grpc.CallOption) (*commands.UpdateDeviceMetadataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.UpdateDeviceMetadataResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_UpdateDeviceMetadata_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_UpdateDeviceMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -183,8 +195,9 @@ func (c *resourceAggregateClient) UpdateDeviceMetadata(ctx context.Context, in * } func (c *resourceAggregateClient) ConfirmDeviceMetadataUpdate(ctx context.Context, in *commands.ConfirmDeviceMetadataUpdateRequest, opts ...grpc.CallOption) (*commands.ConfirmDeviceMetadataUpdateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.ConfirmDeviceMetadataUpdateResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmDeviceMetadataUpdate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_ConfirmDeviceMetadataUpdate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -192,8 +205,9 @@ func (c *resourceAggregateClient) ConfirmDeviceMetadataUpdate(ctx context.Contex } func (c *resourceAggregateClient) CancelPendingMetadataUpdates(ctx context.Context, in *commands.CancelPendingMetadataUpdatesRequest, opts ...grpc.CallOption) (*commands.CancelPendingMetadataUpdatesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.CancelPendingMetadataUpdatesResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_CancelPendingMetadataUpdates_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_CancelPendingMetadataUpdates_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -201,8 +215,9 @@ func (c *resourceAggregateClient) CancelPendingMetadataUpdates(ctx context.Conte } func (c *resourceAggregateClient) CancelPendingCommands(ctx context.Context, in *commands.CancelPendingCommandsRequest, opts ...grpc.CallOption) (*commands.CancelPendingCommandsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.CancelPendingCommandsResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_CancelPendingCommands_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_CancelPendingCommands_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -210,8 +225,9 @@ func (c *resourceAggregateClient) CancelPendingCommands(ctx context.Context, in } func (c *resourceAggregateClient) DeleteDevices(ctx context.Context, in *commands.DeleteDevicesRequest, opts ...grpc.CallOption) (*commands.DeleteDevicesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.DeleteDevicesResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_DeleteDevices_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_DeleteDevices_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -219,8 +235,9 @@ func (c *resourceAggregateClient) DeleteDevices(ctx context.Context, in *command } func (c *resourceAggregateClient) BatchNotifyResourceChanged(ctx context.Context, in *commands.BatchNotifyResourceChangedRequest, opts ...grpc.CallOption) (*commands.BatchNotifyResourceChangedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.BatchNotifyResourceChangedResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_BatchNotifyResourceChanged_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_BatchNotifyResourceChanged_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -228,8 +245,9 @@ func (c *resourceAggregateClient) BatchNotifyResourceChanged(ctx context.Context } func (c *resourceAggregateClient) UpdateServiceMetadata(ctx context.Context, in *commands.UpdateServiceMetadataRequest, opts ...grpc.CallOption) (*commands.UpdateServiceMetadataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(commands.UpdateServiceMetadataResponse) - err := c.cc.Invoke(ctx, ResourceAggregate_UpdateServiceMetadata_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceAggregate_UpdateServiceMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -238,7 +256,7 @@ func (c *resourceAggregateClient) UpdateServiceMetadata(ctx context.Context, in // ResourceAggregateServer is the server API for ResourceAggregate service. // All implementations must embed UnimplementedResourceAggregateServer -// for forward compatibility +// for forward compatibility. type ResourceAggregateServer interface { PublishResourceLinks(context.Context, *commands.PublishResourceLinksRequest) (*commands.PublishResourceLinksResponse, error) UnpublishResourceLinks(context.Context, *commands.UnpublishResourceLinksRequest) (*commands.UnpublishResourceLinksResponse, error) @@ -263,9 +281,12 @@ type ResourceAggregateServer interface { mustEmbedUnimplementedResourceAggregateServer() } -// UnimplementedResourceAggregateServer must be embedded to have forward compatible implementations. -type UnimplementedResourceAggregateServer struct { -} +// UnimplementedResourceAggregateServer 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 UnimplementedResourceAggregateServer struct{} func (UnimplementedResourceAggregateServer) PublishResourceLinks(context.Context, *commands.PublishResourceLinksRequest) (*commands.PublishResourceLinksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PublishResourceLinks not implemented") @@ -322,6 +343,7 @@ func (UnimplementedResourceAggregateServer) UpdateServiceMetadata(context.Contex return nil, status.Errorf(codes.Unimplemented, "method UpdateServiceMetadata not implemented") } func (UnimplementedResourceAggregateServer) mustEmbedUnimplementedResourceAggregateServer() {} +func (UnimplementedResourceAggregateServer) testEmbeddedByValue() {} // UnsafeResourceAggregateServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ResourceAggregateServer will @@ -331,6 +353,13 @@ type UnsafeResourceAggregateServer interface { } func RegisterResourceAggregateServer(s grpc.ServiceRegistrar, srv ResourceAggregateServer) { + // If the following call pancis, it indicates UnimplementedResourceAggregateServer 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() + } s.RegisterService(&ResourceAggregate_ServiceDesc, srv) } diff --git a/resource-directory/pb/getLatestDeviceETags.pb.go b/resource-directory/pb/getLatestDeviceETags.pb.go index dd23301cf..d7a8b7ce1 100644 --- a/resource-directory/pb/getLatestDeviceETags.pb.go +++ b/resource-directory/pb/getLatestDeviceETags.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-directory/pb/getLatestDeviceETags.proto package pb @@ -157,7 +157,7 @@ func file_resource_directory_pb_getLatestDeviceETags_proto_rawDescGZIP() []byte } var file_resource_directory_pb_getLatestDeviceETags_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_resource_directory_pb_getLatestDeviceETags_proto_goTypes = []interface{}{ +var file_resource_directory_pb_getLatestDeviceETags_proto_goTypes = []any{ (*GetLatestDeviceETagsRequest)(nil), // 0: resourcedirectory.pb.GetLatestDeviceETagsRequest (*GetLatestDeviceETagsResponse)(nil), // 1: resourcedirectory.pb.GetLatestDeviceETagsResponse } @@ -175,7 +175,7 @@ func file_resource_directory_pb_getLatestDeviceETags_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_resource_directory_pb_getLatestDeviceETags_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_resource_directory_pb_getLatestDeviceETags_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GetLatestDeviceETagsRequest); i { case 0: return &v.state @@ -187,7 +187,7 @@ func file_resource_directory_pb_getLatestDeviceETags_proto_init() { return nil } } - file_resource_directory_pb_getLatestDeviceETags_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_resource_directory_pb_getLatestDeviceETags_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*GetLatestDeviceETagsResponse); i { case 0: return &v.state diff --git a/resource-directory/pb/service.pb.go b/resource-directory/pb/service.pb.go index dee8516a5..0291e63b0 100644 --- a/resource-directory/pb/service.pb.go +++ b/resource-directory/pb/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: resource-directory/pb/service.proto package pb @@ -45,7 +45,7 @@ var file_resource_directory_pb_service_proto_rawDesc = []byte{ 0x33, } -var file_resource_directory_pb_service_proto_goTypes = []interface{}{ +var file_resource_directory_pb_service_proto_goTypes = []any{ (*GetLatestDeviceETagsRequest)(nil), // 0: resourcedirectory.pb.GetLatestDeviceETagsRequest (*GetLatestDeviceETagsResponse)(nil), // 1: resourcedirectory.pb.GetLatestDeviceETagsResponse } diff --git a/resource-directory/pb/service_grpc.pb.go b/resource-directory/pb/service_grpc.pb.go index 8793ad8c5..e4f93a0ec 100644 --- a/resource-directory/pb/service_grpc.pb.go +++ b/resource-directory/pb/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: resource-directory/pb/service.proto package pb @@ -15,8 +15,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ResourceDirectory_GetLatestDeviceETags_FullMethodName = "/resourcedirectory.pb.ResourceDirectory/GetLatestDeviceETags" @@ -25,6 +25,8 @@ const ( // ResourceDirectoryClient is the client API for ResourceDirectory 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. +// +// Internal API for Resource Directory type ResourceDirectoryClient interface { // Get the most recent device etags, each corresponding to a different resource in order of most recent to least recent. GetLatestDeviceETags(ctx context.Context, in *GetLatestDeviceETagsRequest, opts ...grpc.CallOption) (*GetLatestDeviceETagsResponse, error) @@ -39,8 +41,9 @@ func NewResourceDirectoryClient(cc grpc.ClientConnInterface) ResourceDirectoryCl } func (c *resourceDirectoryClient) GetLatestDeviceETags(ctx context.Context, in *GetLatestDeviceETagsRequest, opts ...grpc.CallOption) (*GetLatestDeviceETagsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLatestDeviceETagsResponse) - err := c.cc.Invoke(ctx, ResourceDirectory_GetLatestDeviceETags_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ResourceDirectory_GetLatestDeviceETags_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,21 +52,27 @@ func (c *resourceDirectoryClient) GetLatestDeviceETags(ctx context.Context, in * // ResourceDirectoryServer is the server API for ResourceDirectory service. // All implementations must embed UnimplementedResourceDirectoryServer -// for forward compatibility +// for forward compatibility. +// +// Internal API for Resource Directory type ResourceDirectoryServer interface { // Get the most recent device etags, each corresponding to a different resource in order of most recent to least recent. GetLatestDeviceETags(context.Context, *GetLatestDeviceETagsRequest) (*GetLatestDeviceETagsResponse, error) mustEmbedUnimplementedResourceDirectoryServer() } -// UnimplementedResourceDirectoryServer must be embedded to have forward compatible implementations. -type UnimplementedResourceDirectoryServer struct { -} +// UnimplementedResourceDirectoryServer 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 UnimplementedResourceDirectoryServer struct{} func (UnimplementedResourceDirectoryServer) GetLatestDeviceETags(context.Context, *GetLatestDeviceETagsRequest) (*GetLatestDeviceETagsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatestDeviceETags not implemented") } func (UnimplementedResourceDirectoryServer) mustEmbedUnimplementedResourceDirectoryServer() {} +func (UnimplementedResourceDirectoryServer) testEmbeddedByValue() {} // UnsafeResourceDirectoryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ResourceDirectoryServer will @@ -73,6 +82,13 @@ type UnsafeResourceDirectoryServer interface { } func RegisterResourceDirectoryServer(s grpc.ServiceRegistrar, srv ResourceDirectoryServer) { + // If the following call pancis, it indicates UnimplementedResourceDirectoryServer 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() + } s.RegisterService(&ResourceDirectory_ServiceDesc, srv) } diff --git a/snippet-service/pb/service.pb.go b/snippet-service/pb/service.pb.go index ab33dcf66..b8438a0aa 100644 --- a/snippet-service/pb/service.pb.go +++ b/snippet-service/pb/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v5.26.1 +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: snippet-service/pb/service.proto package pb @@ -765,8 +765,8 @@ type AppliedConfiguration struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - DeviceId string `protobuf:"bytes,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty" bson:"deviceId"` - ConfigurationId *AppliedConfiguration_LinkedTo `protobuf:"bytes,3,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty" bson:"configurationId"` + DeviceId string `protobuf:"bytes,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty" bson:"deviceId"` + ConfigurationId *AppliedConfiguration_LinkedTo `protobuf:"bytes,3,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty" bson:"configurationId"` // Types that are assignable to ExecutedBy: // // *AppliedConfiguration_OnDemand @@ -882,7 +882,7 @@ type AppliedConfiguration_OnDemand struct { } type AppliedConfiguration_ConditionId struct { - ConditionId *AppliedConfiguration_LinkedTo `protobuf:"bytes,5,opt,name=condition_id,json=conditionId,proto3,oneof" bson:"conditionId"` + ConditionId *AppliedConfiguration_LinkedTo `protobuf:"bytes,5,opt,name=condition_id,json=conditionId,proto3,oneof" bson:"conditionId"` } func (*AppliedConfiguration_OnDemand) isAppliedConfiguration_ExecutedBy() {} @@ -1269,11 +1269,11 @@ type AppliedConfiguration_Resource struct { Href string `protobuf:"bytes,1,opt,name=href,proto3" json:"href,omitempty"` // Reused from invoke command or generated. Can be used to retrieve corresponding pending command. - CorrelationId string `protobuf:"bytes,2,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty" bson:"correlationId"` + CorrelationId string `protobuf:"bytes,2,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty" bson:"correlationId"` Status AppliedConfiguration_Resource_Status `protobuf:"varint,3,opt,name=status,proto3,enum=snippetservice.pb.AppliedConfiguration_Resource_Status" json:"status,omitempty"` - ResourceUpdated *events.ResourceUpdated `protobuf:"bytes,4,opt,name=resource_updated,json=resourceUpdated,proto3" json:"resource_updated,omitempty" bson:"resourceUpdated,omitempty"` + ResourceUpdated *events.ResourceUpdated `protobuf:"bytes,4,opt,name=resource_updated,json=resourceUpdated,proto3" json:"resource_updated,omitempty" bson:"resourceUpdated,omitempty"` // Unix nanoseconds timestamp for resource in PENDING status, until which the pending update is valid - ValidUntil int64 `protobuf:"varint,5,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty" bson:"validUntil,omitempty"` + ValidUntil int64 `protobuf:"varint,5,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty" bson:"validUntil,omitempty"` } func (x *AppliedConfiguration_Resource) Reset() { @@ -1771,7 +1771,7 @@ func file_snippet_service_pb_service_proto_rawDescGZIP() []byte { var file_snippet_service_pb_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_snippet_service_pb_service_proto_msgTypes = make([]protoimpl.MessageInfo, 18) -var file_snippet_service_pb_service_proto_goTypes = []interface{}{ +var file_snippet_service_pb_service_proto_goTypes = []any{ (AppliedConfiguration_Resource_Status)(0), // 0: snippetservice.pb.AppliedConfiguration.Resource.Status (*IDFilter)(nil), // 1: snippetservice.pb.IDFilter (*Condition)(nil), // 2: snippetservice.pb.Condition @@ -1843,7 +1843,7 @@ func file_snippet_service_pb_service_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_snippet_service_pb_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*IDFilter); i { case 0: return &v.state @@ -1855,7 +1855,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Condition); i { case 0: return &v.state @@ -1867,7 +1867,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*GetConditionsRequest); i { case 0: return &v.state @@ -1879,7 +1879,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*DeleteConditionsRequest); i { case 0: return &v.state @@ -1891,7 +1891,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*DeleteConditionsResponse); i { case 0: return &v.state @@ -1903,7 +1903,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*Configuration); i { case 0: return &v.state @@ -1915,7 +1915,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*GetConfigurationsRequest); i { case 0: return &v.state @@ -1927,7 +1927,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*DeleteConfigurationsRequest); i { case 0: return &v.state @@ -1939,7 +1939,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*DeleteConfigurationsResponse); i { case 0: return &v.state @@ -1951,7 +1951,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*AppliedConfiguration); i { case 0: return &v.state @@ -1963,7 +1963,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*InvokeConfigurationRequest); i { case 0: return &v.state @@ -1975,7 +1975,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*InvokeConfigurationResponse); i { case 0: return &v.state @@ -1987,7 +1987,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*GetAppliedConfigurationsRequest); i { case 0: return &v.state @@ -1999,7 +1999,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*DeleteAppliedConfigurationsRequest); i { case 0: return &v.state @@ -2011,7 +2011,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*DeleteAppliedConfigurationsResponse); i { case 0: return &v.state @@ -2023,7 +2023,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*Configuration_Resource); i { case 0: return &v.state @@ -2035,7 +2035,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*AppliedConfiguration_Resource); i { case 0: return &v.state @@ -2047,7 +2047,7 @@ func file_snippet_service_pb_service_proto_init() { return nil } } - file_snippet_service_pb_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_snippet_service_pb_service_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*AppliedConfiguration_LinkedTo); i { case 0: return &v.state @@ -2060,12 +2060,12 @@ func file_snippet_service_pb_service_proto_init() { } } } - file_snippet_service_pb_service_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_snippet_service_pb_service_proto_msgTypes[0].OneofWrappers = []any{ (*IDFilter_Value)(nil), (*IDFilter_All)(nil), (*IDFilter_Latest)(nil), } - file_snippet_service_pb_service_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_snippet_service_pb_service_proto_msgTypes[9].OneofWrappers = []any{ (*AppliedConfiguration_OnDemand)(nil), (*AppliedConfiguration_ConditionId)(nil), } diff --git a/snippet-service/pb/service.pb.gw.go b/snippet-service/pb/service.pb.gw.go index 191bb172d..e43db7591 100644 --- a/snippet-service/pb/service.pb.gw.go +++ b/snippet-service/pb/service.pb.gw.go @@ -459,6 +459,7 @@ func local_request_SnippetService_DeleteAppliedConfigurations_0(ctx context.Cont // UnaryRPC :call SnippetServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSnippetServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterSnippetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SnippetServiceServer) error { mux.Handle("POST", pattern_SnippetService_CreateCondition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -720,7 +721,7 @@ func RegisterSnippetServiceHandler(ctx context.Context, mux *runtime.ServeMux, c // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SnippetServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SnippetServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "SnippetServiceClient" to call the correct interceptors. +// "SnippetServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterSnippetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SnippetServiceClient) error { mux.Handle("POST", pattern_SnippetService_CreateCondition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { diff --git a/snippet-service/pb/service_grpc.pb.go b/snippet-service/pb/service_grpc.pb.go index 6b06ada8c..1f3ece2d4 100644 --- a/snippet-service/pb/service_grpc.pb.go +++ b/snippet-service/pb/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.26.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 // source: snippet-service/pb/service.proto package pb @@ -15,8 +15,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( SnippetService_CreateCondition_FullMethodName = "/snippetservice.pb.SnippetService/CreateCondition" @@ -37,18 +37,18 @@ const ( // 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 SnippetServiceClient interface { CreateCondition(ctx context.Context, in *Condition, opts ...grpc.CallOption) (*Condition, error) - GetConditions(ctx context.Context, in *GetConditionsRequest, opts ...grpc.CallOption) (SnippetService_GetConditionsClient, error) + GetConditions(ctx context.Context, in *GetConditionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Condition], error) DeleteConditions(ctx context.Context, in *DeleteConditionsRequest, opts ...grpc.CallOption) (*DeleteConditionsResponse, error) // For update the condition whole condition is required and the version must be incremented. UpdateCondition(ctx context.Context, in *Condition, opts ...grpc.CallOption) (*Condition, error) CreateConfiguration(ctx context.Context, in *Configuration, opts ...grpc.CallOption) (*Configuration, error) - GetConfigurations(ctx context.Context, in *GetConfigurationsRequest, opts ...grpc.CallOption) (SnippetService_GetConfigurationsClient, error) + GetConfigurations(ctx context.Context, in *GetConfigurationsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Configuration], error) DeleteConfigurations(ctx context.Context, in *DeleteConfigurationsRequest, opts ...grpc.CallOption) (*DeleteConfigurationsResponse, error) // For update the configuration whole configuration is required and the version must be incremented. UpdateConfiguration(ctx context.Context, in *Configuration, opts ...grpc.CallOption) (*Configuration, error) // streaming process of update configuration to invoker InvokeConfiguration(ctx context.Context, in *InvokeConfigurationRequest, opts ...grpc.CallOption) (*InvokeConfigurationResponse, error) - GetAppliedConfigurations(ctx context.Context, in *GetAppliedConfigurationsRequest, opts ...grpc.CallOption) (SnippetService_GetAppliedConfigurationsClient, error) + GetAppliedConfigurations(ctx context.Context, in *GetAppliedConfigurationsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[AppliedConfiguration], error) DeleteAppliedConfigurations(ctx context.Context, in *DeleteAppliedConfigurationsRequest, opts ...grpc.CallOption) (*DeleteAppliedConfigurationsResponse, error) } @@ -61,20 +61,22 @@ func NewSnippetServiceClient(cc grpc.ClientConnInterface) SnippetServiceClient { } func (c *snippetServiceClient) CreateCondition(ctx context.Context, in *Condition, opts ...grpc.CallOption) (*Condition, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Condition) - err := c.cc.Invoke(ctx, SnippetService_CreateCondition_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_CreateCondition_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *snippetServiceClient) GetConditions(ctx context.Context, in *GetConditionsRequest, opts ...grpc.CallOption) (SnippetService_GetConditionsClient, error) { - stream, err := c.cc.NewStream(ctx, &SnippetService_ServiceDesc.Streams[0], SnippetService_GetConditions_FullMethodName, opts...) +func (c *snippetServiceClient) GetConditions(ctx context.Context, in *GetConditionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Condition], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &SnippetService_ServiceDesc.Streams[0], SnippetService_GetConditions_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &snippetServiceGetConditionsClient{stream} + x := &grpc.GenericClientStream[GetConditionsRequest, Condition]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -84,26 +86,13 @@ func (c *snippetServiceClient) GetConditions(ctx context.Context, in *GetConditi return x, nil } -type SnippetService_GetConditionsClient interface { - Recv() (*Condition, error) - grpc.ClientStream -} - -type snippetServiceGetConditionsClient struct { - grpc.ClientStream -} - -func (x *snippetServiceGetConditionsClient) Recv() (*Condition, error) { - m := new(Condition) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type SnippetService_GetConditionsClient = grpc.ServerStreamingClient[Condition] func (c *snippetServiceClient) DeleteConditions(ctx context.Context, in *DeleteConditionsRequest, opts ...grpc.CallOption) (*DeleteConditionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteConditionsResponse) - err := c.cc.Invoke(ctx, SnippetService_DeleteConditions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_DeleteConditions_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -111,8 +100,9 @@ func (c *snippetServiceClient) DeleteConditions(ctx context.Context, in *DeleteC } func (c *snippetServiceClient) UpdateCondition(ctx context.Context, in *Condition, opts ...grpc.CallOption) (*Condition, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Condition) - err := c.cc.Invoke(ctx, SnippetService_UpdateCondition_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_UpdateCondition_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -120,20 +110,22 @@ func (c *snippetServiceClient) UpdateCondition(ctx context.Context, in *Conditio } func (c *snippetServiceClient) CreateConfiguration(ctx context.Context, in *Configuration, opts ...grpc.CallOption) (*Configuration, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Configuration) - err := c.cc.Invoke(ctx, SnippetService_CreateConfiguration_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_CreateConfiguration_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *snippetServiceClient) GetConfigurations(ctx context.Context, in *GetConfigurationsRequest, opts ...grpc.CallOption) (SnippetService_GetConfigurationsClient, error) { - stream, err := c.cc.NewStream(ctx, &SnippetService_ServiceDesc.Streams[1], SnippetService_GetConfigurations_FullMethodName, opts...) +func (c *snippetServiceClient) GetConfigurations(ctx context.Context, in *GetConfigurationsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Configuration], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &SnippetService_ServiceDesc.Streams[1], SnippetService_GetConfigurations_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &snippetServiceGetConfigurationsClient{stream} + x := &grpc.GenericClientStream[GetConfigurationsRequest, Configuration]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -143,26 +135,13 @@ func (c *snippetServiceClient) GetConfigurations(ctx context.Context, in *GetCon return x, nil } -type SnippetService_GetConfigurationsClient interface { - Recv() (*Configuration, error) - grpc.ClientStream -} - -type snippetServiceGetConfigurationsClient struct { - grpc.ClientStream -} - -func (x *snippetServiceGetConfigurationsClient) Recv() (*Configuration, error) { - m := new(Configuration) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type SnippetService_GetConfigurationsClient = grpc.ServerStreamingClient[Configuration] func (c *snippetServiceClient) DeleteConfigurations(ctx context.Context, in *DeleteConfigurationsRequest, opts ...grpc.CallOption) (*DeleteConfigurationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteConfigurationsResponse) - err := c.cc.Invoke(ctx, SnippetService_DeleteConfigurations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_DeleteConfigurations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -170,8 +149,9 @@ func (c *snippetServiceClient) DeleteConfigurations(ctx context.Context, in *Del } func (c *snippetServiceClient) UpdateConfiguration(ctx context.Context, in *Configuration, opts ...grpc.CallOption) (*Configuration, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Configuration) - err := c.cc.Invoke(ctx, SnippetService_UpdateConfiguration_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_UpdateConfiguration_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -179,20 +159,22 @@ func (c *snippetServiceClient) UpdateConfiguration(ctx context.Context, in *Conf } func (c *snippetServiceClient) InvokeConfiguration(ctx context.Context, in *InvokeConfigurationRequest, opts ...grpc.CallOption) (*InvokeConfigurationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(InvokeConfigurationResponse) - err := c.cc.Invoke(ctx, SnippetService_InvokeConfiguration_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_InvokeConfiguration_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *snippetServiceClient) GetAppliedConfigurations(ctx context.Context, in *GetAppliedConfigurationsRequest, opts ...grpc.CallOption) (SnippetService_GetAppliedConfigurationsClient, error) { - stream, err := c.cc.NewStream(ctx, &SnippetService_ServiceDesc.Streams[2], SnippetService_GetAppliedConfigurations_FullMethodName, opts...) +func (c *snippetServiceClient) GetAppliedConfigurations(ctx context.Context, in *GetAppliedConfigurationsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[AppliedConfiguration], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &SnippetService_ServiceDesc.Streams[2], SnippetService_GetAppliedConfigurations_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &snippetServiceGetAppliedConfigurationsClient{stream} + x := &grpc.GenericClientStream[GetAppliedConfigurationsRequest, AppliedConfiguration]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -202,26 +184,13 @@ func (c *snippetServiceClient) GetAppliedConfigurations(ctx context.Context, in return x, nil } -type SnippetService_GetAppliedConfigurationsClient interface { - Recv() (*AppliedConfiguration, error) - grpc.ClientStream -} - -type snippetServiceGetAppliedConfigurationsClient struct { - grpc.ClientStream -} - -func (x *snippetServiceGetAppliedConfigurationsClient) Recv() (*AppliedConfiguration, error) { - m := new(AppliedConfiguration) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type SnippetService_GetAppliedConfigurationsClient = grpc.ServerStreamingClient[AppliedConfiguration] func (c *snippetServiceClient) DeleteAppliedConfigurations(ctx context.Context, in *DeleteAppliedConfigurationsRequest, opts ...grpc.CallOption) (*DeleteAppliedConfigurationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteAppliedConfigurationsResponse) - err := c.cc.Invoke(ctx, SnippetService_DeleteAppliedConfigurations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, SnippetService_DeleteAppliedConfigurations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -230,33 +199,36 @@ func (c *snippetServiceClient) DeleteAppliedConfigurations(ctx context.Context, // SnippetServiceServer is the server API for SnippetService service. // All implementations must embed UnimplementedSnippetServiceServer -// for forward compatibility +// for forward compatibility. type SnippetServiceServer interface { CreateCondition(context.Context, *Condition) (*Condition, error) - GetConditions(*GetConditionsRequest, SnippetService_GetConditionsServer) error + GetConditions(*GetConditionsRequest, grpc.ServerStreamingServer[Condition]) error DeleteConditions(context.Context, *DeleteConditionsRequest) (*DeleteConditionsResponse, error) // For update the condition whole condition is required and the version must be incremented. UpdateCondition(context.Context, *Condition) (*Condition, error) CreateConfiguration(context.Context, *Configuration) (*Configuration, error) - GetConfigurations(*GetConfigurationsRequest, SnippetService_GetConfigurationsServer) error + GetConfigurations(*GetConfigurationsRequest, grpc.ServerStreamingServer[Configuration]) error DeleteConfigurations(context.Context, *DeleteConfigurationsRequest) (*DeleteConfigurationsResponse, error) // For update the configuration whole configuration is required and the version must be incremented. UpdateConfiguration(context.Context, *Configuration) (*Configuration, error) // streaming process of update configuration to invoker InvokeConfiguration(context.Context, *InvokeConfigurationRequest) (*InvokeConfigurationResponse, error) - GetAppliedConfigurations(*GetAppliedConfigurationsRequest, SnippetService_GetAppliedConfigurationsServer) error + GetAppliedConfigurations(*GetAppliedConfigurationsRequest, grpc.ServerStreamingServer[AppliedConfiguration]) error DeleteAppliedConfigurations(context.Context, *DeleteAppliedConfigurationsRequest) (*DeleteAppliedConfigurationsResponse, error) mustEmbedUnimplementedSnippetServiceServer() } -// UnimplementedSnippetServiceServer must be embedded to have forward compatible implementations. -type UnimplementedSnippetServiceServer struct { -} +// UnimplementedSnippetServiceServer 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 UnimplementedSnippetServiceServer struct{} func (UnimplementedSnippetServiceServer) CreateCondition(context.Context, *Condition) (*Condition, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateCondition not implemented") } -func (UnimplementedSnippetServiceServer) GetConditions(*GetConditionsRequest, SnippetService_GetConditionsServer) error { +func (UnimplementedSnippetServiceServer) GetConditions(*GetConditionsRequest, grpc.ServerStreamingServer[Condition]) error { return status.Errorf(codes.Unimplemented, "method GetConditions not implemented") } func (UnimplementedSnippetServiceServer) DeleteConditions(context.Context, *DeleteConditionsRequest) (*DeleteConditionsResponse, error) { @@ -268,7 +240,7 @@ func (UnimplementedSnippetServiceServer) UpdateCondition(context.Context, *Condi func (UnimplementedSnippetServiceServer) CreateConfiguration(context.Context, *Configuration) (*Configuration, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateConfiguration not implemented") } -func (UnimplementedSnippetServiceServer) GetConfigurations(*GetConfigurationsRequest, SnippetService_GetConfigurationsServer) error { +func (UnimplementedSnippetServiceServer) GetConfigurations(*GetConfigurationsRequest, grpc.ServerStreamingServer[Configuration]) error { return status.Errorf(codes.Unimplemented, "method GetConfigurations not implemented") } func (UnimplementedSnippetServiceServer) DeleteConfigurations(context.Context, *DeleteConfigurationsRequest) (*DeleteConfigurationsResponse, error) { @@ -280,13 +252,14 @@ func (UnimplementedSnippetServiceServer) UpdateConfiguration(context.Context, *C func (UnimplementedSnippetServiceServer) InvokeConfiguration(context.Context, *InvokeConfigurationRequest) (*InvokeConfigurationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InvokeConfiguration not implemented") } -func (UnimplementedSnippetServiceServer) GetAppliedConfigurations(*GetAppliedConfigurationsRequest, SnippetService_GetAppliedConfigurationsServer) error { +func (UnimplementedSnippetServiceServer) GetAppliedConfigurations(*GetAppliedConfigurationsRequest, grpc.ServerStreamingServer[AppliedConfiguration]) error { return status.Errorf(codes.Unimplemented, "method GetAppliedConfigurations not implemented") } func (UnimplementedSnippetServiceServer) DeleteAppliedConfigurations(context.Context, *DeleteAppliedConfigurationsRequest) (*DeleteAppliedConfigurationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteAppliedConfigurations not implemented") } func (UnimplementedSnippetServiceServer) mustEmbedUnimplementedSnippetServiceServer() {} +func (UnimplementedSnippetServiceServer) testEmbeddedByValue() {} // UnsafeSnippetServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SnippetServiceServer will @@ -296,6 +269,13 @@ type UnsafeSnippetServiceServer interface { } func RegisterSnippetServiceServer(s grpc.ServiceRegistrar, srv SnippetServiceServer) { + // If the following call pancis, it indicates UnimplementedSnippetServiceServer 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() + } s.RegisterService(&SnippetService_ServiceDesc, srv) } @@ -322,21 +302,11 @@ func _SnippetService_GetConditions_Handler(srv interface{}, stream grpc.ServerSt if err := stream.RecvMsg(m); err != nil { return err } - return srv.(SnippetServiceServer).GetConditions(m, &snippetServiceGetConditionsServer{stream}) -} - -type SnippetService_GetConditionsServer interface { - Send(*Condition) error - grpc.ServerStream + return srv.(SnippetServiceServer).GetConditions(m, &grpc.GenericServerStream[GetConditionsRequest, Condition]{ServerStream: stream}) } -type snippetServiceGetConditionsServer struct { - grpc.ServerStream -} - -func (x *snippetServiceGetConditionsServer) Send(m *Condition) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type SnippetService_GetConditionsServer = grpc.ServerStreamingServer[Condition] func _SnippetService_DeleteConditions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteConditionsRequest) @@ -397,21 +367,11 @@ func _SnippetService_GetConfigurations_Handler(srv interface{}, stream grpc.Serv if err := stream.RecvMsg(m); err != nil { return err } - return srv.(SnippetServiceServer).GetConfigurations(m, &snippetServiceGetConfigurationsServer{stream}) + return srv.(SnippetServiceServer).GetConfigurations(m, &grpc.GenericServerStream[GetConfigurationsRequest, Configuration]{ServerStream: stream}) } -type SnippetService_GetConfigurationsServer interface { - Send(*Configuration) error - grpc.ServerStream -} - -type snippetServiceGetConfigurationsServer struct { - grpc.ServerStream -} - -func (x *snippetServiceGetConfigurationsServer) Send(m *Configuration) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type SnippetService_GetConfigurationsServer = grpc.ServerStreamingServer[Configuration] func _SnippetService_DeleteConfigurations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteConfigurationsRequest) @@ -472,21 +432,11 @@ func _SnippetService_GetAppliedConfigurations_Handler(srv interface{}, stream gr if err := stream.RecvMsg(m); err != nil { return err } - return srv.(SnippetServiceServer).GetAppliedConfigurations(m, &snippetServiceGetAppliedConfigurationsServer{stream}) + return srv.(SnippetServiceServer).GetAppliedConfigurations(m, &grpc.GenericServerStream[GetAppliedConfigurationsRequest, AppliedConfiguration]{ServerStream: stream}) } -type SnippetService_GetAppliedConfigurationsServer interface { - Send(*AppliedConfiguration) error - grpc.ServerStream -} - -type snippetServiceGetAppliedConfigurationsServer struct { - grpc.ServerStream -} - -func (x *snippetServiceGetAppliedConfigurationsServer) Send(m *AppliedConfiguration) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type SnippetService_GetAppliedConfigurationsServer = grpc.ServerStreamingServer[AppliedConfiguration] func _SnippetService_DeleteAppliedConfigurations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteAppliedConfigurationsRequest)