https://github.com/s2-streamstore/s2-sdk-go
Go SDK for S2
https://github.com/s2-streamstore/s2-sdk-go
go golang grpc s2 sdk serverless store stream streaming
Last synced: 9 months ago
JSON representation
Go SDK for S2
- Host: GitHub
- URL: https://github.com/s2-streamstore/s2-sdk-go
- Owner: s2-streamstore
- License: apache-2.0
- Created: 2024-12-24T22:17:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T08:51:20.000Z (9 months ago)
- Last Synced: 2025-03-26T09:39:58.332Z (9 months ago)
- Topics: go, golang, grpc, s2, sdk, serverless, store, stream, streaming
- Language: Go
- Homepage: https://s2.dev
- Size: 243 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
The Go SDK provides ergonomic wrappers and utilities to interact with the
[S2 API](https://s2.dev/docs/interface/grpc).
## Getting started
1. Create a new Go project:
```bash
mkdir s2-sdk-test
cd s2-sdk-test
go mod init example.com/s2-sdk-test
touch main.go
```
1. Add the `s2` dependency to your project:
```bash
go get github.com/s2-streamstore/s2-sdk-go/s2@latest
```
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
// main.go
package main
import (
"context"
"fmt"
"github.com/s2-streamstore/s2-sdk-go/s2"
)
func main() {
client, err := s2.NewClient("")
if err != nil {
panic(err)
}
basins, err := client.ListBasins(context.TODO(), &s2.ListBasinsRequest{})
if err != nil {
panic(err)
}
fmt.Println(basins)
}
```
Run the above program using `go run main.go`.
## 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 "" \
-stream "" \
-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 [hi@s2.dev](mailto:hi@s2.dev).
## License
This project is licensed under the [Apache-2.0 License](./LICENSE).