The Go SDK provides ergonomic wrappers and utilities to interact with the S2 API.
-
Add the
s2
dependency to your project:go get github.com/s2-streamstore/s2-sdk-go/s2
-
Generate an authentication token by logging onto the web console at s2.dev.
-
Make a request using SDK client.
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) }
The s2/example_test.go
contains a variety of example
use cases demonstrating how to use the SDK effectively.
For a more practical example, try out the SDK by running the Starwars example:
go run ./examples/starwars \
-basin "<basin name>" \
-stream "<stream name>" \
-token "<auth token>"
Head over to pkg.go.dev for detailed documentation and package reference.
We use Github 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.
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.
Join our Discord server. We would love to hear from you.
You can also email us at [email protected].
This project is licensed under the Apache-2.0 License.