Powered by the gRPC API.

Getting started

  1. Create a new Go project:

    mkdir s2-sdk-test
    cd s2-sdk-test
    go mod init example.com/s2-sdk-test
    touch main.go
    
  2. Add the s2 dependency to your project:

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

  4. Make a request using SDK client.

    // main.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 {
        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.