Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved commands.InstanceContainer -> rpc.InstanceCommand
  • Loading branch information
cmaglie committed Aug 23, 2022
commit 3b39d7c0ace7f66b4d37a3bfd8fe10d2b3231c16
7 changes: 1 addition & 6 deletions commands/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ type CoreInstance struct {
lm *librariesmanager.LibrariesManager
}

// InstanceContainer FIXMEDOC
type InstanceContainer interface {
GetInstance() *rpc.Instance
}

// GetInstance returns a CoreInstance for the given ID, or nil if ID
// doesn't exist
func GetInstance(id int32) *CoreInstance {
Expand All @@ -86,7 +81,7 @@ func GetPackageManager(id int32) *packagemanager.PackageManager {
// GetPackageManagerExplorer returns a new package manager Explorer. The
// explorer holds a read lock on the underlying PackageManager and it should
// be released by calling the returned "release" function.
func GetPackageManagerExplorer(instance InstanceContainer) (explorer *packagemanager.Explorer, release func()) {
func GetPackageManagerExplorer(instance rpc.InstanceCommand) (explorer *packagemanager.Explorer, release func()) {
i := GetInstance(instance.GetInstance().GetId())
if i == nil {
return nil, nil
Expand Down
6 changes: 6 additions & 0 deletions rpc/cc/arduino/cli/commands/v1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ type DownloadProgressCB func(curr *DownloadProgress)

// TaskProgressCB is a callback to receive progress messages
type TaskProgressCB func(msg *TaskProgress)

// InstanceCommand is an interface thar represents a gRPC command with
// a gRPC Instance.
type InstanceCommand interface {
GetInstance() *Instance
}