Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getting started documentation for go driver #1227

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 58 additions & 0 deletions 0-getting-started/drivers/go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
layout: documentation
title: Installing the Go driver
title_image: /assets/images/docs/driver-languages/go.png
docs_active: install-drivers
permalink: docs/install-drivers/go/
---
{% include docs/install-driver-docs-header.md %}

# Installation #

Install the driver with `go get`:

```bash
$ go get gopkg.in/rethinkdb/rethinkdb-go.v5
```

# Usage #

You can use the drivers from Go like this:

```go
package rethinkdb_test

import (
"fmt"
"log"

r "gopkg.in/rethinkdb/rethinkdb-go.v5"
)

func Example() {
session, err := r.Connect(r.ConnectOpts{
Address: url, // endpoint without http
})
if err != nil {
log.Fatalln(err)
}

res, err := r.Expr("Hello World").Run(session)
if err != nil {
log.Fatalln(err)
}

var response string
err = res.One(&response)
if err != nil {
log.Fatalln(err)
}

fmt.Println(response)

// Output:
// Hello World
}
```

To view the full documentation check out [GoDoc](https://godoc.org/github.com/rethinkdb/rethinkdb-go).
14 changes: 7 additions & 7 deletions 0-getting-started/drivers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ alias: docs/guides/drivers/
<p class="name">Java</p>
</a>
</li>
<li>
<a href="go/">
<img src="/assets/images/docs/driver-languages/go.png" />
<p class="name">Go</p>
</a>
</li>
</ul>
</section>

Expand Down Expand Up @@ -95,12 +101,6 @@ alias: docs/guides/drivers/
<p class="name">Erlang</p>
</a>
</li>
<li>
<a href="https://github.com/dancannon/gorethink">
<img src="/assets/images/docs/driver-languages/go.png" />
<p class="name">Go</p>
</a>
</li>
<li>
<a href="http://hackage.haskell.org/package/rethinkdb">
<img src="/assets/images/docs/driver-languages/haskell.png" />
Expand Down Expand Up @@ -207,7 +207,7 @@ __Thanks to all our amazing driver contributors!__
- [@bchavez](https://github.com/bchavez) (C#/.NET): [https://github.com/bchavez/RethinkDb.Driver](https://github.com/bchavez/RethinkDb.Driver)
- [@billysometimes](https://github.com/billysometimes) (Dart): <https://github.com/billysometimes/rethinkdb>
- [@brandonhamilton](https://github.com/brandonhamilton) (Delphi): <https://github.com/brandonhamilton/rethinkdb-delphi>
- [@dancannon](https://github.com/dancannon) (Go): <https://github.com/dancannon/gorethink>
- [@dancannon](https://github.com/dancannon) (Go): <https://github.com/rethinkdb/rethinkdb-go>
- [@danielmewes](https://github.com/danielmewes) (PHP): <https://github.com/danielmewes/php-rql>
- [@dkhenry](https://github.com/dkhenry) (Java): <https://github.com/dkhenry/rethinkjava>
- [@dparnell](https://github.com/dparnell) (Objective-C): <https://github.com/dparnell/rethink-db-client>
Expand Down