[ARVADOS] created: 87070c3467a966d5e35a784c769b40d023de0759
git at public.curoverse.com
git at public.curoverse.com
Sat Aug 9 11:06:33 EDT 2014
at 87070c3467a966d5e35a784c769b40d023de0759 (commit)
commit 87070c3467a966d5e35a784c769b40d023de0759
Author: Tom Clegg <tom at curoverse.com>
Date: Sat Aug 9 11:00:53 2014 -0400
3551: Fix source tree layout: GOPATH is not in the source tree.
diff --git a/.gitignore b/.gitignore
index 0cddee5..9ddcf07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,9 +11,6 @@ sdk/perl/Makefile
sdk/perl/blib
sdk/perl/pm_to_blib
*/vendor/bundle
-services/keep/bin
-services/keep/pkg
-services/keep/src/github.com
sdk/java/target
*.class
apps/workbench/vendor/bundle
diff --git a/doc/sdk/go/index.html.textile.liquid b/doc/sdk/go/index.html.textile.liquid
new file mode 100644
index 0000000..86ab996
--- /dev/null
+++ b/doc/sdk/go/index.html.textile.liquid
@@ -0,0 +1,65 @@
+---
+layout: default
+navsection: sdk
+navmenu: Go
+title: "Go SDK"
+
+...
+
+The Go ("Golang":http://golang.org) SDK provides a generic set of wrappers so you can make API calls easily.
+
+h3. Installation
+
+You don't need to install anything. Just import the client like this. The go tools will fetch the relevant code and dependencies for you.
+
+<notextile>
+<pre>import (
+ keepclient "git.curoverse.com/arvados.git/sdk/go/keepclient"
+ arvadosclient "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
+)
+</pre>
+</notextile>
+
+h3. Examples
+
+Import the module. (We import the log module here too, so we can use it in the subsequent examples.)
+
+<notextile>
+<pre><code class="userinput">import (
+ keepclient "git.curoverse.com/arvados.git/sdk/go/keepclient"
+ arvadosclient "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
+ "log"
+)
+</code></pre>
+</notextile>
+
+Set up an API client user agent:
+
+<notextile>
+<pre><code class="userinput"> arv, err := arvadosclient.MakeArvadosClient()
+ if err != nil {
+ log.Fatalf("Error setting up arvados client %s", err.Error())
+ }
+</code></pre>
+</notextile>
+
+Get the User object for the current user:
+
+<notextile>
+<pre><code class="userinput"> type user struct {
+ Uuid string `json:"uuid"`
+ FullName int `json:"full_name"`
+ }
+
+ var u user
+ err := arv.Call("GET", "users", "", "current", nil, &u)
+
+ if err != nil {
+ return err
+ }
+
+ log.Printf("Logged in as %s (uuid %s)", user.Uuid, user.FullName)
+</code></pre>
+</notextile>
+
+A few more usage examples can be found in the services/keepproxy and sdk/go/keepclient directories in the arvados source tree.
diff --git a/doc/sdk/index.html.textile.liquid b/doc/sdk/index.html.textile.liquid
index 1b1e18a..db5d6f1 100644
--- a/doc/sdk/index.html.textile.liquid
+++ b/doc/sdk/index.html.textile.liquid
@@ -10,6 +10,7 @@ This section documents how to access the Arvados API and Keep using various prog
* "Perl SDK":{{site.baseurl}}/sdk/perl/index.html
* "Ruby SDK":{{site.baseurl}}/sdk/ruby/index.html
* "Java SDK":{{site.baseurl}}/sdk/java/index.html
+* "Go SDK":{{site.baseurl}}/sdk/go/index.html
* "Command line SDK":{{site.baseurl}}/sdk/cli/index.html ("arv")
SDKs not yet implemented:
diff --git a/sdk/go/src/arvados.org/sdk/sdk.go b/sdk/go/arvadosclient/sdk.go
similarity index 100%
rename from sdk/go/src/arvados.org/sdk/sdk.go
rename to sdk/go/arvadosclient/sdk.go
diff --git a/sdk/go/src/arvados.org/sdk/sdk_test.go b/sdk/go/arvadosclient/sdk_test.go
similarity index 100%
rename from sdk/go/src/arvados.org/sdk/sdk_test.go
rename to sdk/go/arvadosclient/sdk_test.go
diff --git a/sdk/go/go.sh b/sdk/go/go.sh
deleted file mode 100755
index 5553567..0000000
--- a/sdk/go/go.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/sh
-
-# Wraps the 'go' executable with some environment setup. Sets GOPATH, creates
-# 'pkg' and 'bin' directories, automatically installs dependencies, then runs
-# the underlying 'go' executable with any command line parameters provided to
-# the script.
-
-rootdir=$(readlink -f $(dirname $0))
-GOPATH=$rootdir:$GOPATH
-export GOPATH
-
-mkdir -p $rootdir/pkg
-mkdir -p $rootdir/bin
-
-go get gopkg.in/check.v1
-
-go $*
diff --git a/sdk/go/src/arvados.org/keepclient/hashcheck.go b/sdk/go/keepclient/hashcheck.go
similarity index 100%
rename from sdk/go/src/arvados.org/keepclient/hashcheck.go
rename to sdk/go/keepclient/hashcheck.go
diff --git a/sdk/go/src/arvados.org/keepclient/hashcheck_test.go b/sdk/go/keepclient/hashcheck_test.go
similarity index 100%
rename from sdk/go/src/arvados.org/keepclient/hashcheck_test.go
rename to sdk/go/keepclient/hashcheck_test.go
diff --git a/sdk/go/src/arvados.org/keepclient/keepclient.go b/sdk/go/keepclient/keepclient.go
similarity index 97%
rename from sdk/go/src/arvados.org/keepclient/keepclient.go
rename to sdk/go/keepclient/keepclient.go
index d43a215..aa7e78b 100644
--- a/sdk/go/src/arvados.org/keepclient/keepclient.go
+++ b/sdk/go/keepclient/keepclient.go
@@ -2,8 +2,8 @@
package keepclient
import (
- "arvados.org/sdk"
- "arvados.org/streamer"
+ streamer "git.curoverse.com/arvados.git/sdk/go/streamer"
+ arvadosclient "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"crypto/md5"
"errors"
"fmt"
@@ -33,7 +33,7 @@ const X_Keep_Replicas_Stored = "X-Keep-Replicas-Stored"
// Information about Arvados and Keep servers.
type KeepClient struct {
- Arvados *sdk.ArvadosClient
+ Arvados *arvadosclient.ArvadosClient
Want_replicas int
Using_proxy bool
service_roots *[]string
@@ -43,7 +43,7 @@ type KeepClient struct {
// Create a new KeepClient. This will contact the API server to discover Keep
// servers.
-func MakeKeepClient(arv *sdk.ArvadosClient) (kc KeepClient, err error) {
+func MakeKeepClient(arv *arvadosclient.ArvadosClient) (kc KeepClient, err error) {
kc = KeepClient{
Arvados: arv,
Want_replicas: 2,
diff --git a/sdk/go/src/arvados.org/keepclient/keepclient_test.go b/sdk/go/keepclient/keepclient_test.go
similarity index 100%
rename from sdk/go/src/arvados.org/keepclient/keepclient_test.go
rename to sdk/go/keepclient/keepclient_test.go
diff --git a/sdk/go/src/arvados.org/keepclient/support.go b/sdk/go/keepclient/support.go
similarity index 99%
rename from sdk/go/src/arvados.org/keepclient/support.go
rename to sdk/go/keepclient/support.go
index f3e47f9..ce15ce9 100644
--- a/sdk/go/src/arvados.org/keepclient/support.go
+++ b/sdk/go/keepclient/support.go
@@ -2,7 +2,7 @@
package keepclient
import (
- "arvados.org/streamer"
+ "git.curoverse.com/arvados.git/sdk/go/streamer"
"errors"
"fmt"
"io"
diff --git a/sdk/go/src/arvados.org/streamer/streamer.go b/sdk/go/streamer/streamer.go
similarity index 100%
rename from sdk/go/src/arvados.org/streamer/streamer.go
rename to sdk/go/streamer/streamer.go
diff --git a/sdk/go/src/arvados.org/streamer/streamer_test.go b/sdk/go/streamer/streamer_test.go
similarity index 100%
rename from sdk/go/src/arvados.org/streamer/streamer_test.go
rename to sdk/go/streamer/streamer_test.go
diff --git a/sdk/go/src/arvados.org/streamer/transfer.go b/sdk/go/streamer/transfer.go
similarity index 100%
rename from sdk/go/src/arvados.org/streamer/transfer.go
rename to sdk/go/streamer/transfer.go
diff --git a/services/keep/src/arvados.org/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
similarity index 98%
rename from services/keep/src/arvados.org/keepproxy/keepproxy.go
rename to services/keepproxy/keepproxy.go
index 367854b..367a9c5 100644
--- a/services/keep/src/arvados.org/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -1,8 +1,8 @@
package main
import (
- "arvados.org/keepclient"
- "arvados.org/sdk"
+ keepclient "git.curoverse.com/arvados.git/sdk/go/keepclient"
+ arvadosclient "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"flag"
"fmt"
"github.com/gorilla/mux"
@@ -68,7 +68,7 @@ func main() {
flagset.Parse(os.Args[1:])
- arv, err := sdk.MakeArvadosClient()
+ arv, err := arvadosclient.MakeArvadosClient()
if err != nil {
log.Fatalf("Error setting up arvados client %s", err.Error())
}
diff --git a/services/keep/src/arvados.org/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go
similarity index 100%
rename from services/keep/src/arvados.org/keepproxy/keepproxy_test.go
rename to services/keepproxy/keepproxy_test.go
diff --git a/services/keep/src/keep/handler_test.go b/services/keepstore/handler_test.go
similarity index 100%
rename from services/keep/src/keep/handler_test.go
rename to services/keepstore/handler_test.go
diff --git a/services/keep/src/keep/handlers.go b/services/keepstore/handlers.go
similarity index 100%
rename from services/keep/src/keep/handlers.go
rename to services/keepstore/handlers.go
diff --git a/services/keep/src/keep/keep.go b/services/keepstore/keepstore.go
similarity index 100%
rename from services/keep/src/keep/keep.go
rename to services/keepstore/keepstore.go
diff --git a/services/keep/src/keep/keep_test.go b/services/keepstore/keepstore_test.go
similarity index 100%
rename from services/keep/src/keep/keep_test.go
rename to services/keepstore/keepstore_test.go
diff --git a/services/keep/src/keep/perms.go b/services/keepstore/perms.go
similarity index 100%
rename from services/keep/src/keep/perms.go
rename to services/keepstore/perms.go
diff --git a/services/keep/src/keep/perms_test.go b/services/keepstore/perms_test.go
similarity index 100%
rename from services/keep/src/keep/perms_test.go
rename to services/keepstore/perms_test.go
diff --git a/services/keep/src/keep/volume.go b/services/keepstore/volume.go
similarity index 100%
rename from services/keep/src/keep/volume.go
rename to services/keepstore/volume.go
diff --git a/services/keep/src/keep/volume_unix.go b/services/keepstore/volume_unix.go
similarity index 100%
rename from services/keep/src/keep/volume_unix.go
rename to services/keepstore/volume_unix.go
diff --git a/services/keep/src/keep/volume_unix_test.go b/services/keepstore/volume_unix_test.go
similarity index 100%
rename from services/keep/src/keep/volume_unix_test.go
rename to services/keepstore/volume_unix_test.go
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list