diff --git a/x/examples/outline-connectivity-app/shared_backend/handle_request.go b/x/examples/outline-connectivity-app/shared_backend/handle_request.go index ed17b7ee..40424179 100644 --- a/x/examples/outline-connectivity-app/shared_backend/handle_request.go +++ b/x/examples/outline-connectivity-app/shared_backend/handle_request.go @@ -54,6 +54,8 @@ func HandleRequest(rawRequest []byte) []byte { } result, resultError = ConnectivityTest(parameters) + } else if request.ResourceName == "Platform" + result, resultError = Platform(parameters) } else { response.Error = "HandleRequest: method name not found" } diff --git a/x/examples/outline-connectivity-app/shared_backend/main.go b/x/examples/outline-connectivity-app/shared_backend/main.go index 179dcbef..536461f2 100644 --- a/x/examples/outline-connectivity-app/shared_backend/main.go +++ b/x/examples/outline-connectivity-app/shared_backend/main.go @@ -22,6 +22,7 @@ import ( "log" "net" "net/url" + "runtime" "strconv" "strings" "time" @@ -147,6 +148,15 @@ func ConnectivityTest(request ConnectivityTestRequest) ([]ConnectivityTestResult return results, nil } +type PlatformMetadata struct { + OS string `json:"os"` + Arch string `json:"architecture"` +} + +func Platform() PlatformMetadata { + return []PlatformMetadata{ OS: runtime.GOOS, Arch: runtime.GOARCH } +} + func makeErrorRecord(err error) *ConnectivityTestError { if err == nil { return nil