Skip to content

Commit

Permalink
docs: README
Browse files Browse the repository at this point in the history
  • Loading branch information
vrongmeal committed Jan 10, 2025
1 parent 4caab49 commit f1f7aee
Showing 1 changed file with 74 additions and 4 deletions.
78 changes: 74 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
<h1>Go SDK for S2</h1>

<p>
<!-- TODO: Badges for pkg.go.dev and CI -->
<!-- pkg.go.dev -->
<a href="https://pkg.go.dev/github.com/s2-streamstore/s2-sdk-go/s2"><img src="https://pkg.go.dev/badge/github.com/s2-streamstore/s2-sdk-go/s2.svg" /></a>
<!-- Discord (chat) -->
<a href="https://discord.gg/vTCs7kMkAf"><img src="https://img.shields.io/discord/1209937852528599092?logo=discord" /></a>
<!-- Github Actions (CI) -->
<a href="https://github.com/s2-streamstore/s2-sdk-go/actions?query=branch%3Amain++"><img src="https://github.com/s2-streamstore/s2-sdk-go/actions/workflows/ci.yml/badge.svg" /></a>
<!-- LICENSE -->
<a href="./LICENSE"><img src="https://img.shields.io/github/license/s2-streamstore/s2-sdk-go" /></a>
</p>
Expand All @@ -26,15 +29,82 @@ The Go SDK provides ergonomic wrappers and utilities to interact with the

---

This project is a **WORK IN PROGRESS**
## Getting started

## Starwars
1. Add the `s2` dependency to your project:
```bash
go get github.com/s2-streamstore/s2-sdk-go/s2
```

Try out the SDK by running the Starwars example:
1. Generate an authentication token by logging onto the web console at
[s2.dev](https://s2.dev/dashboard).

1. Make a request using SDK client.
```go
package main

import (
"context"
"fmt"

"github.com/s2-streamstore/s2-sdk-go/s2"
)

func main() {
client, err := s2.NewClient("<YOUR AUTH TOKEN>")
if err != nil {
// Handle error.
}

basins, err := client.ListBasins(&s2.ListBasinsRequest{})
if err != nil {
// Handle error.
}

fmt.Println(basins)
}
```

## Examples

The [`s2/example_test.go`](./s2/example_test.go) contains a variety of example
use cases demonstrating how to use the SDK effectively.

### Starwars

For a more practical example, try out the SDK by running the Starwars example:

```bash
go run ./examples/starwars \
-basin "<basin name>" \
-stream "<stream name>" \
-token "<auth token>"
```

## SDK Docs and Reference

Head over to [pkg.go.dev](https://pkg.go.dev/github.com/s2-streamstore/s2-sdk-go/s2)
for detailed documentation and package reference.

## Feedback

We use [Github Issues](https://github.com/s2-streamstore/s2-sdk-go/issues) to
track feature requests and issues with the SDK. If you wish to provide feedback,
report a bug or request a feature, feel free to open a Github issue.

### Contributing

Developers are welcome to submit Pull Requests on the repository. If there is
no tracking issue for the bug or feature request corresponding to the PR, we
encourage you to open one for discussion before submitting the PR.

## Reach out to us

Join our [Discord](https://discord.gg/vTCs7kMkAf) server. We would love to hear
from you.

You can also email us at [[email protected]](mailto:[email protected]).

## License

This project is licensed under the [Apache-2.0 License](./LICENSE).

0 comments on commit f1f7aee

Please sign in to comment.