Unverified Commit e9ade7e6 authored by Cristian Maglie's avatar Cristian Maglie Committed by GitHub

[skip-changelog] Added deprecation warning for gRPC MonitorService (#1648)

* Added deprecation warning for gRPC MonitorService

* Apply suggestions from code review
Co-authored-by: default avatarper1234 <accounts@perglass.com>

* Added deprecation option
Co-authored-by: default avatarper1234 <accounts@perglass.com>
parent 18cb00c2
This diff is collapsed.
...@@ -17,12 +17,18 @@ syntax = "proto3"; ...@@ -17,12 +17,18 @@ syntax = "proto3";
package cc.arduino.cli.monitor.v1; package cc.arduino.cli.monitor.v1;
option deprecated = true;
option go_package = "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/monitor/v1;monitor"; option go_package = "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/monitor/v1;monitor";
import "google/protobuf/struct.proto"; import "google/protobuf/struct.proto";
// MonitorService provides services for boards monitor // MonitorService provides services for boards monitor.
// DEPRECATION WARNING: MonitorService is deprecated and will be removed in a
// future release. Use ArduinoCoreService.Monitor and
// ArduinoCoreService.EnumerateMonitorPortSettings instead.
service MonitorService { service MonitorService {
option deprecated = true;
// Open a bidirectional monitor stream. This can be used to implement // Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor. // something similar to the Arduino IDE's Serial Monitor.
rpc StreamingOpen(stream StreamingOpenRequest) rpc StreamingOpen(stream StreamingOpenRequest)
...@@ -34,7 +40,12 @@ service MonitorService { ...@@ -34,7 +40,12 @@ service MonitorService {
// must contain a `monitor_config` message to initialize the monitor target. // must contain a `monitor_config` message to initialize the monitor target.
// All subsequent messages must contain bytes to be sent to the target // All subsequent messages must contain bytes to be sent to the target
// and must not contain a `monitor_config` message. // and must not contain a `monitor_config` message.
// DEPRECATION WARNING: StreamingOpenRequest is deprecated and will be removed
// in a future release. Use ArduinoCoreService.Monitor and
// ArduinoCoreService.EnumerateMonitorPortSettings instead.
message StreamingOpenRequest { message StreamingOpenRequest {
option deprecated = true;
// Content must be either a monitor config or data to be sent. // Content must be either a monitor config or data to be sent.
oneof content { oneof content {
// Provides information to the monitor that specifies which is the target. // Provides information to the monitor that specifies which is the target.
...@@ -53,7 +64,12 @@ message StreamingOpenRequest { ...@@ -53,7 +64,12 @@ message StreamingOpenRequest {
// Tells the monitor which target to open and provides additional parameters // Tells the monitor which target to open and provides additional parameters
// that might be needed to configure the target or the monitor itself. // that might be needed to configure the target or the monitor itself.
// DEPRECATION WARNING: MonitorConfig is deprecated and will be removed
// in a future release. Use ArduinoCoreService.Monitor and
// ArduinoCoreService.EnumerateMonitorPortSettings instead.
message MonitorConfig { message MonitorConfig {
option deprecated = true;
enum TargetType { enum TargetType {
TARGET_TYPE_SERIAL = 0; TARGET_TYPE_SERIAL = 0;
TARGET_TYPE_NULL = 99; TARGET_TYPE_NULL = 99;
...@@ -73,7 +89,12 @@ message MonitorConfig { ...@@ -73,7 +89,12 @@ message MonitorConfig {
int32 recv_rate_limit_buffer = 4; int32 recv_rate_limit_buffer = 4;
} }
// DEPRECATION WARNING: StreamingOpenResponse is deprecated and will be removed
// in a future release. Use ArduinoCoreService.Monitor and
// ArduinoCoreService.EnumerateMonitorPortSettings instead.
message StreamingOpenResponse { message StreamingOpenResponse {
option deprecated = true;
// The data received from the target. // The data received from the target.
bytes data = 1; bytes data = 1;
......
...@@ -17,6 +17,8 @@ const _ = grpc.SupportPackageIsVersion7 ...@@ -17,6 +17,8 @@ const _ = grpc.SupportPackageIsVersion7
// MonitorServiceClient is the client API for MonitorService service. // MonitorServiceClient is the client API for MonitorService 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. // 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.
//
// Deprecated: Do not use.
type MonitorServiceClient interface { type MonitorServiceClient interface {
// Open a bidirectional monitor stream. This can be used to implement // Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor. // something similar to the Arduino IDE's Serial Monitor.
...@@ -27,6 +29,7 @@ type monitorServiceClient struct { ...@@ -27,6 +29,7 @@ type monitorServiceClient struct {
cc grpc.ClientConnInterface cc grpc.ClientConnInterface
} }
// Deprecated: Do not use.
func NewMonitorServiceClient(cc grpc.ClientConnInterface) MonitorServiceClient { func NewMonitorServiceClient(cc grpc.ClientConnInterface) MonitorServiceClient {
return &monitorServiceClient{cc} return &monitorServiceClient{cc}
} }
...@@ -65,6 +68,8 @@ func (x *monitorServiceStreamingOpenClient) Recv() (*StreamingOpenResponse, erro ...@@ -65,6 +68,8 @@ func (x *monitorServiceStreamingOpenClient) Recv() (*StreamingOpenResponse, erro
// MonitorServiceServer is the server API for MonitorService service. // MonitorServiceServer is the server API for MonitorService service.
// All implementations must embed UnimplementedMonitorServiceServer // All implementations must embed UnimplementedMonitorServiceServer
// for forward compatibility // for forward compatibility
//
// Deprecated: Do not use.
type MonitorServiceServer interface { type MonitorServiceServer interface {
// Open a bidirectional monitor stream. This can be used to implement // Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor. // something similar to the Arduino IDE's Serial Monitor.
...@@ -88,6 +93,7 @@ type UnsafeMonitorServiceServer interface { ...@@ -88,6 +93,7 @@ type UnsafeMonitorServiceServer interface {
mustEmbedUnimplementedMonitorServiceServer() mustEmbedUnimplementedMonitorServiceServer()
} }
// Deprecated: Do not use.
func RegisterMonitorServiceServer(s grpc.ServiceRegistrar, srv MonitorServiceServer) { func RegisterMonitorServiceServer(s grpc.ServiceRegistrar, srv MonitorServiceServer) {
s.RegisterService(&MonitorService_ServiceDesc, srv) s.RegisterService(&MonitorService_ServiceDesc, srv)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment