Skip to content

Commit c2ede18

Browse files
committed
Removed redundant and useless commands from gRPC interface
1 parent 5efa9b5 commit c2ede18

File tree

7 files changed

+546
-1404
lines changed

7 files changed

+546
-1404
lines changed

commands/daemon/daemon.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ import (
2828
"github.com/arduino/arduino-cli/commands/core"
2929
"github.com/arduino/arduino-cli/commands/lib"
3030
"github.com/arduino/arduino-cli/commands/monitor"
31-
"github.com/arduino/arduino-cli/commands/outdated"
3231
"github.com/arduino/arduino-cli/commands/sketch"
33-
"github.com/arduino/arduino-cli/commands/upgrade"
3432
"github.com/arduino/arduino-cli/commands/upload"
3533
"github.com/arduino/arduino-cli/i18n"
3634
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
@@ -178,43 +176,6 @@ func (s *ArduinoCoreServerImpl) UpdateLibrariesIndex(req *rpc.UpdateLibrariesInd
178176
return stream.Send(&rpc.UpdateLibrariesIndexResponse{})
179177
}
180178

181-
// UpdateCoreLibrariesIndex FIXMEDOC
182-
func (s *ArduinoCoreServerImpl) UpdateCoreLibrariesIndex(req *rpc.UpdateCoreLibrariesIndexRequest, stream rpc.ArduinoCoreService_UpdateCoreLibrariesIndexServer) error {
183-
err := commands.UpdateCoreLibrariesIndex(stream.Context(), req,
184-
func(p *rpc.DownloadProgress) { stream.Send(&rpc.UpdateCoreLibrariesIndexResponse{DownloadProgress: p}) },
185-
)
186-
if err != nil {
187-
return convertErrorToRPCStatus(err)
188-
}
189-
return stream.Send(&rpc.UpdateCoreLibrariesIndexResponse{})
190-
}
191-
192-
// Outdated FIXMEDOC
193-
func (s *ArduinoCoreServerImpl) Outdated(ctx context.Context, req *rpc.OutdatedRequest) (*rpc.OutdatedResponse, error) {
194-
resp, err := outdated.Outdated(ctx, req)
195-
return resp, convertErrorToRPCStatus(err)
196-
}
197-
198-
// Upgrade FIXMEDOC
199-
func (s *ArduinoCoreServerImpl) Upgrade(req *rpc.UpgradeRequest, stream rpc.ArduinoCoreService_UpgradeServer) error {
200-
err := upgrade.Upgrade(stream.Context(), req,
201-
func(p *rpc.DownloadProgress) {
202-
stream.Send(&rpc.UpgradeResponse{
203-
Progress: p,
204-
})
205-
},
206-
func(p *rpc.TaskProgress) {
207-
stream.Send(&rpc.UpgradeResponse{
208-
TaskProgress: p,
209-
})
210-
},
211-
)
212-
if err != nil {
213-
return convertErrorToRPCStatus(err)
214-
}
215-
return stream.Send(&rpc.UpgradeResponse{})
216-
}
217-
218179
// Create FIXMEDOC
219180
func (s *ArduinoCoreServerImpl) Create(ctx context.Context, req *rpc.CreateRequest) (*rpc.CreateResponse, error) {
220181
var userAgent []string

commands/instances.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -544,21 +544,6 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rp
544544
return nil
545545
}
546546

547-
// UpdateCoreLibrariesIndex updates both Cores and Libraries indexes
548-
func UpdateCoreLibrariesIndex(ctx context.Context, req *rpc.UpdateCoreLibrariesIndexRequest, downloadCB rpc.DownloadProgressCB) error {
549-
err := UpdateIndex(ctx, &rpc.UpdateIndexRequest{Instance: req.Instance}, downloadCB)
550-
if err != nil {
551-
return err
552-
}
553-
554-
err = UpdateLibrariesIndex(ctx, &rpc.UpdateLibrariesIndexRequest{Instance: req.Instance}, downloadCB)
555-
if err != nil {
556-
return err
557-
}
558-
559-
return nil
560-
}
561-
562547
// LoadSketch collects and returns all files composing a sketch
563548
func LoadSketch(ctx context.Context, req *rpc.LoadSketchRequest) (*rpc.LoadSketchResponse, error) {
564549
// TODO: This should be a ToRpc function for the Sketch struct

commands/outdated/outdated.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

commands/upgrade/upgrade.go

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)