Skip to content

Commit 7d9edc7

Browse files
committed
Moved commands.InstanceContainer -> rpc.InstanceCommand
1 parent 0a4bad9 commit 7d9edc7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

commands/instances.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ type CoreInstance struct {
6060
lm *librariesmanager.LibrariesManager
6161
}
6262

63-
// InstanceContainer FIXMEDOC
64-
type InstanceContainer interface {
65-
GetInstance() *rpc.Instance
66-
}
67-
6863
// GetInstance returns a CoreInstance for the given ID, or nil if ID
6964
// doesn't exist
7065
func GetInstance(id int32) *CoreInstance {
@@ -86,7 +81,7 @@ func GetPackageManager(id int32) *packagemanager.PackageManager {
8681
// GetPackageManagerExplorer returns a new package manager Explorer. The
8782
// explorer holds a read lock on the underlying PackageManager and it should
8883
// be released by calling the returned "release" function.
89-
func GetPackageManagerExplorer(instance InstanceContainer) (explorer *packagemanager.Explorer, release func()) {
84+
func GetPackageManagerExplorer(instance rpc.InstanceCommand) (explorer *packagemanager.Explorer, release func()) {
9085
i := GetInstance(instance.GetInstance().GetId())
9186
if i == nil {
9287
return nil, nil

rpc/cc/arduino/cli/commands/v1/common.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ type DownloadProgressCB func(curr *DownloadProgress)
2020

2121
// TaskProgressCB is a callback to receive progress messages
2222
type TaskProgressCB func(msg *TaskProgress)
23+
24+
// InstanceCommand is an interface thar represents a gRPC command with
25+
// a gRPC Instance.
26+
type InstanceCommand interface {
27+
GetInstance() *Instance
28+
}

0 commit comments

Comments
 (0)