7444: Clean stopped containers at startup.
[arvados.git] / doc / sdk / go / index.html.textile.liquid
index 27c4448469d669996ace373e626f5557f0048196..24873318da20dea0eaa2582706c7fb03c37ad6e7 100644 (file)
@@ -12,54 +12,14 @@ 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><code class="userinput">import (
-       keepclient    "git.curoverse.com/arvados.git/sdk/go/keepclient"
-       arvadosclient "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
-)
-</code></pre>
-</notextile>
+<notextile>{% code 'example_sdk_go_imports' as go %}</notextile>
 
-h3. Examples
+If you need pre-release client code, you can use the latest version from the repo by following "these instructions.":https://dev.arvados.org/projects/arvados/wiki/Go#Using-Go-with-Arvados
 
-Import the module. (We import the log module here too, so we can use it in the subsequent examples.)
+h3. Example
 
-<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>
+You can save this source as a .go file and run it:
 
-Set up an API client user agent:
+<notextile>{% code 'example_sdk_go' as go %}</notextile>
 
-<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.
+A few more usage examples can be found in the "services/keepproxy":https://dev.arvados.org/projects/arvados/repository/revisions/master/show/services/keepproxy and "sdk/go/keepclient":https://dev.arvados.org/projects/arvados/repository/revisions/master/show/sdk/go/keepclient directories in the arvados source tree.