Skip to main content
The Go SDK provides an idiomatic Go interface for interacting with S2, with support for goroutines, context, and channels.
The Go SDK is compatible with S2 v1 API (v0.11+) and ready for production use.

Installation

Install via go get:

Quick Start

Initialize the Client

Basic Operations

Working with Basins

Create a Basin

List Basins

Get Basin Configuration

Delete a Basin

Working with Streams

Create a Stream

List Streams

Delete a Stream

Writing Records

Using the Producer

Batch Append

Reading Records

Using the Reader

Read with Options

Single Read

Check Tail

Context and Cancellation

All SDK methods accept a context.Context for timeout and cancellation:

Access Tokens

Issue a Token

List Tokens

Revoke a Token

Metrics

Error Handling

Configuration

Custom Endpoint

HTTP Client Customization

Concurrency

The SDK is safe for concurrent use:

Resources

GitHub

Source code and documentation

Go.dev

API reference documentation

REST API

Underlying REST API reference

Discord

Join our community

Next Steps