Skip to content

Commit

Permalink
feat(device_infos): added a function to get basic go infos
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddi committed Oct 24, 2018
1 parent f7101cd commit f8f73ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/node/nodeapi_devtools.go
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/base64"
"fmt"
"math/rand"
"runtime"
"strings"

"berty.tech/core/api/node"
Expand Down Expand Up @@ -97,3 +98,12 @@ func (n *Node) GenerateFakeData(_ context.Context, input *node.Void) (*node.Void

return &node.Void{}, nil
}

func (n *Node) DeviceInfos(_ context.Context, input *node.Void) (*node.DeviceInfosOutput, error) {
output := &node.DeviceInfosOutput{}
output.Infos = append(output.Infos, &node.DeviceInfo{Key: "OS", Value: runtime.GOOS})
output.Infos = append(output.Infos, &node.DeviceInfo{Key: "Arch", Value: runtime.GOARCH})
output.Infos = append(output.Infos, &node.DeviceInfo{Key: "Go version", Value: runtime.Version()})

return output, nil
}

0 comments on commit f8f73ee

Please sign in to comment.