Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[skip changelog] Demonstrate gRPC interface's LibraryResolveDependencies method in client_example#552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
masci merged 2 commits intoarduino:masterfromper1234:libraryresolvedependencies
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
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
2 changes: 1 addition & 1 deletionclient_example/go.mod
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,4 +6,4 @@ require (
github.com/arduino/arduino-cli v0.0.0-20200109150215-ffa84fdaab21
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282 // indirect
google.golang.org/grpc v1.23.0
)
)
24 changes: 24 additions & 0 deletionsclient_example/main.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -164,6 +164,10 @@ func main() {
log.Println("calling LibrarySearch(audio)")
callLibSearch(client, instance)

// List the dependencies of the ArduinoIoTCloud library
log.Println("calling LibraryResolveDependencies(ArduinoIoTCloud)")
callLibraryResolveDependencies(client, instance)

// List installed libraries
log.Println("calling LibraryList")
callLibList(client, instance)
Expand DownExpand Up@@ -734,6 +738,26 @@ func callLibSearch(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
}
}

func callLibraryResolveDependencies(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
libraryResolveDependenciesResp, err := client.LibraryResolveDependencies(context.Background(),
&rpc.LibraryResolveDependenciesReq{
Instance: instance,
Name: "ArduinoIoTCloud",
})

if err != nil {
log.Fatalf("Error listing library dependencies: %s", err)
}

for _, resp := range libraryResolveDependenciesResp.GetDependencies() {
log.Printf("Dependency Name: %s", resp.GetName())
log.Printf("Version Required: %s", resp.GetVersionRequired())
if resp.GetVersionInstalled() != "" {
log.Printf("Version Installed: %s\n", resp.GetVersionInstalled())
}
}
}

func callLibList(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
libLstResp, err := client.LibraryList(context.Background(),
&rpc.LibraryListReq{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp