Skip to content

s2-streamstore/s2-sdk-go

Repository files navigation

Go SDK for S2

The Go SDK provides ergonomic wrappers and utilities to interact with the S2 API.

Getting started

  1. Add the s2 dependency to your project:

    go get github.com/s2-streamstore/s2-sdk-go/s2
  2. Generate an authentication token by logging onto the web console at s2.dev.

  3. 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)
    }

Examples

The 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:

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

SDK Docs and Reference

Head over to pkg.go.dev for detailed documentation and package reference.

Feedback

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.

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 server. We would love to hear from you.

You can also email us at [email protected].

License

This project is licensed under the Apache-2.0 License.