diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..f10cf1c --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +package_name="nova-cluster" + + +platforms=("windows/amd64" "windows/386" "darwin/amd64") + +for platform in "${platforms[@]}" +do + platform_split=(${platform//\// }) + GOOS=${platform_split[0]} + GOARCH=${platform_split[1]} + output_name=$package_name'-'$GOOS'-'$GOARCH + if [ $GOOS = "windows" ]; then + output_name+='.exe' + fi + + env GOOS=$GOOS GOARCH=$GOARCH go build -o build/$output_name + if [ $? -ne 0 ]; then + echo 'An error has occurred! Aborting the script execution...' + exit 1 + fi +done \ No newline at end of file diff --git a/main.go b/main.go index 850a92a..d6327ad 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,14 @@ type ViewJob struct { Data interface{} `json:"data"` } +type NovaClient struct { + Src string `json:"src"` +} + +type Meta struct { + NovaClient NovaClient `json:"novaClient"` +} + // ViewJobResult is the view result from hypernova. type ViewJobResult struct { Name string `json:"name"` @@ -32,6 +40,7 @@ type ViewJobResult struct { Duration float32 `json:"duration"` Success bool `json:"success"` Error ViewJobError `json:"error"` + Meta Meta `json:"meta"` } // ViewJobError is an error happened during and after a view is requesting.