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";
package cc.arduino.cli.monitor.v1;
option deprecated = true;
option go_package = "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/monitor/v1;monitor";
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 {
option deprecated = true;
// Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor.
rpc StreamingOpen(stream StreamingOpenRequest)
......@@ -34,7 +40,12 @@ service MonitorService {
// must contain a `monitor_config` message to initialize the monitor target.
// All subsequent messages must contain bytes to be sent to the target
// 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 {
option deprecated = true;
// Content must be either a monitor config or data to be sent.
oneof content {
// Provides information to the monitor that specifies which is the target.
......@@ -53,7 +64,12 @@ message StreamingOpenRequest {
// Tells the monitor which target to open and provides additional parameters
// 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 {
option deprecated = true;
enum TargetType {
TARGET_TYPE_SERIAL = 0;
TARGET_TYPE_NULL = 99;
......@@ -73,7 +89,12 @@ message MonitorConfig {
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 {
option deprecated = true;
// The data received from the target.
bytes data = 1;
......
......@@ -17,6 +17,8 @@ const _ = grpc.SupportPackageIsVersion7
// 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.
//
// Deprecated: Do not use.
type MonitorServiceClient interface {
// Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor.
......@@ -27,6 +29,7 @@ type monitorServiceClient struct {
cc grpc.ClientConnInterface
}
// Deprecated: Do not use.
func NewMonitorServiceClient(cc grpc.ClientConnInterface) MonitorServiceClient {
return &monitorServiceClient{cc}
}
......@@ -65,6 +68,8 @@ func (x *monitorServiceStreamingOpenClient) Recv() (*StreamingOpenResponse, erro
// MonitorServiceServer is the server API for MonitorService service.
// All implementations must embed UnimplementedMonitorServiceServer
// for forward compatibility
//
// Deprecated: Do not use.
type MonitorServiceServer interface {
// Open a bidirectional monitor stream. This can be used to implement
// something similar to the Arduino IDE's Serial Monitor.
......@@ -88,6 +93,7 @@ type UnsafeMonitorServiceServer interface {
mustEmbedUnimplementedMonitorServiceServer()
}
// Deprecated: Do not use.
func RegisterMonitorServiceServer(s grpc.ServiceRegistrar, srv MonitorServiceServer) {
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