Skip to content
This repository was archived by the owner on Nov 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/coverage-minimums.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"github.com/liran/sink-go": 84,
"github.com/liran/sink-go/uri": 91
"github.com/batchstream/sink-go": 84,
"github.com/batchstream/sink-go/uri": 91
}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ jobs:
CANDIDATE_REF: ${{ github.head_ref }}
run: |
ref=main
if [[ -n "${CANDIDATE_REF}" ]] && git ls-remote --exit-code --heads https://github.com/liran/sink.git "refs/heads/${CANDIDATE_REF}" >/dev/null 2>&1; then
if [[ -n "${CANDIDATE_REF}" ]] && git ls-remote --exit-code --heads https://github.com/batchstream/sink.git "refs/heads/${CANDIDATE_REF}" >/dev/null 2>&1; then
ref="${CANDIDATE_REF}"
fi
echo "ref=${ref}" >> "${GITHUB_OUTPUT}"

- name: Check out Sink server
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: liran/sink
repository: batchstream/sink
path: sink-server
ref: ${{ steps.server-ref.outputs.ref }}

Expand All @@ -104,7 +104,7 @@ jobs:

- name: Verify matching protobuf contract
run: |
sed 's#github.com/liran/sink/gen/sink;sink#github.com/liran/sink-go/api/sink/v1;sinkv1#' \
sed 's#github.com/batchstream/sink/gen/sink;sink#github.com/batchstream/sink-go/api/sink/v1;sinkv1#' \
sink-server/proto/sink/sink.proto | diff -u - proto/sink/sink.proto

- name: Start Sink with MongoDB and Kafka
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ proto:
GOBIN=$(BIN_DIR) go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@$(PROTOC_GEN_GO_VTPROTO_VERSION)
PATH="$(BIN_DIR):$$PATH" protoc \
--proto_path=proto \
--go_out=. --go_opt=module=github.com/liran/sink-go \
--go-grpc_out=. --go-grpc_opt=module=github.com/liran/sink-go \
--go-vtproto_out=. --go-vtproto_opt=module=github.com/liran/sink-go,features=marshal+unmarshal+size \
--go_out=. --go_opt=module=github.com/batchstream/sink-go \
--go-grpc_out=. --go-grpc_opt=module=github.com/batchstream/sink-go \
--go-vtproto_out=. --go-vtproto_opt=module=github.com/batchstream/sink-go,features=marshal+unmarshal+size \
proto/sink/sink.proto
@perl -0pi -e 's/\treturn &sinkClient\{cc\}\n/\tclient := \&sinkClient{cc}\n\treturn client\n/' api/sink/v1/sink_grpc.pb.go
@perl -0pi -e 's/^(\s*)m\.([A-Za-z]+) = append\(m\.\2, &([A-Za-z]+)\{\}\)\n/$$1item := \&$${3}{}\n$$1m.$$2 = append(m.$$2, item)\n/gm' api/sink/v1/sink_vtproto.pb.go
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# sink-go

`sink-go` is the typed, concurrency-safe Go client for the
[`liran/sink`](https://github.com/liran/sink) gRPC service. It covers the full
[`batchstream/sink`](https://github.com/batchstream/sink) gRPC service. It covers the full
batch API: reads, puts, self-contained Lua merges, and hard deletes with synchronous
or durable asynchronous completion.
Native `Execute` commands and resumable `Scan` pages use the
Expand All @@ -10,7 +10,7 @@ same Sink connection, while returned writes support atomic read-modify-write res
## Install

```shell
go get github.com/liran/sink-go
go get github.com/batchstream/sink-go
```

The client requires Go 1.27 or newer.
Expand All @@ -32,7 +32,7 @@ canonical URI for Engine affinity. All Gateways with the same Engine membership
select the same Engine for a record. Membership changes may temporarily split
traffic. No exclusive ownership or cross-replica ordering is promised.

The shared `github.com/liran/sink-go/uri` package builds, parses and validates
The shared `github.com/batchstream/sink-go/uri` package builds, parses and validates
URIs. String keys use `s:`, int64 keys `i:`, bytes keys `b:` plus unpadded base64url,
and opaque keys `o:<base64url type>:<base64url data>`. The builder escapes each
path segment; encoded slashes are part of a segment. Alternate URI spellings,
Expand All @@ -57,7 +57,7 @@ import (
"log"
"time"

sink "github.com/liran/sink-go"
sink "github.com/batchstream/sink-go"
"google.golang.org/grpc/credentials/insecure"
)

Expand Down Expand Up @@ -188,7 +188,7 @@ function receives `nil` as `current` and its returned object is created.

The merge function receives only `current` and `incoming`. Sink provides
versioned `sink.v1` array, object, and retry-stable time helpers. See the
[Lua merge developer guide](https://github.com/liran/sink/blob/main/docs/lua-merge-guide.md)
[Lua merge developer guide](https://github.com/batchstream/sink/blob/main/docs/lua-merge-guide.md)
for the complete function reference and reliability rules.

## Request helpers and defaults
Expand Down Expand Up @@ -393,7 +393,7 @@ operations remain available. Index lifecycle operations, alias changes,
settings/templates, lifecycle policies and unknown administrative/plugin write
routes return `INVALID_ARGUMENT` before reaching the backend. GET/HEAD/OPTIONS
can still inspect native endpoints. See the server's
[native access contract](https://github.com/liran/sink/blob/main/docs/native-access.md#elasticsearch-and-opensearch-endpoints)
[native access contract](https://github.com/batchstream/sink/blob/main/docs/native-access.md#elasticsearch-and-opensearch-endpoints)
for supported routes. This protection requires an updated server; upgrading
this SDK alone does not restrict older servers. External administration and
existing lifecycle policies must be coordinated with record clients, which must
Expand Down Expand Up @@ -647,7 +647,7 @@ synchronous completion and is rejected with `CompletionReturnAfterAccepted`.
A timeout can still leave a mutation's outcome unknown; this is not exactly-once
increment delivery or a multi-document transaction.

See the server's [native access contract](https://github.com/liran/sink/blob/main/docs/native-access.md)
See the server's [native access contract](https://github.com/batchstream/sink/blob/main/docs/native-access.md)
for cursor restrictions, native write semantics, raw metadata, byte limits, and
scan deadlines.

Expand Down Expand Up @@ -702,11 +702,11 @@ plus accepted requests that still retain an old Engine address snapshot.
Kubernetes `preStop` is part of the total termination grace period, whereas
Sink's `shutdown_timeout` bounds gRPC draining after SIGTERM. A refresh interval
shorter than `preStop` is not sufficient by itself. See the server's
[rollout timing and qualification guide](https://github.com/liran/sink/blob/main/docs/rolling-upgrades.md).
[rollout timing and qualification guide](https://github.com/batchstream/sink/blob/main/docs/rolling-upgrades.md).

The URI-only SDK release line starting with v0.8.0 pairs with Sink v0.15.0 or
later compatible releases. Upgrade the three server roles and clients together
using the [configuration migration guide](https://github.com/liran/sink/blob/main/docs/configuration-migration.md);
using the [configuration migration guide](https://github.com/batchstream/sink/blob/main/docs/configuration-migration.md);
v0.7.x and the earlier multi-Store protocol are not wire-compatible with this line.

Reads retry transport-level `Unavailable` failures and retryable per-operation
Expand Down
2 changes: 1 addition & 1 deletion api/sink/v1/sink.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions balancing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/batchstream/sink-go/internal/testuri"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/resolver"
Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

sinkv1 "github.com/liran/sink-go/api/sink/v1"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"google.golang.org/grpc"
_ "google.golang.org/grpc/balancer/roundrobin"
"google.golang.org/grpc/codes"
Expand Down
8 changes: 4 additions & 4 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/liran/sink-go/uri"
"github.com/batchstream/sink-go/internal/testuri"
"github.com/batchstream/sink-go/uri"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"go.mongodb.org/mongo-driver/v2/bson"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"slices"
"testing"

sinkv1 "github.com/liran/sink-go/api/sink/v1"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"google.golang.org/protobuf/reflect/protoreflect"
)

Expand Down
2 changes: 1 addition & 1 deletion dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"fmt"

"github.com/liran/sink-go/uri"
"github.com/batchstream/sink-go/uri"
)

// DatasetOptions binds the stable routing, encoding, and optional merge
Expand Down
6 changes: 3 additions & 3 deletions dataset_native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/batchstream/sink-go/internal/testuri"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"go.mongodb.org/mongo-driver/v2/bson"
)

Expand Down
6 changes: 3 additions & 3 deletions dataset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/batchstream/sink-go/internal/testuri"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"go.mongodb.org/mongo-driver/v2/bson"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
6 changes: 3 additions & 3 deletions dns_balancing_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/batchstream/sink-go/internal/testuri"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"golang.org/x/net/dns/dnsmessage"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/liran/sink-go
module github.com/batchstream/sink-go

go 1.27.0

Expand Down
4 changes: 2 additions & 2 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/batchstream/sink-go/internal/testuri"

sink "github.com/liran/sink-go"
sink "github.com/batchstream/sink-go"
"google.golang.org/grpc/credentials/insecure"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/testuri/uri.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package testuri constructs canonical URI fixtures for tests.
package testuri

import "github.com/liran/sink-go/uri"
import "github.com/batchstream/sink-go/uri"

func Resource(store string, segments []string) string {
address, err := uri.New(store, segments)
Expand Down
4 changes: 2 additions & 2 deletions native.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"sort"
"strings"

sinkv1 "github.com/liran/sink-go/api/sink/v1"
"github.com/liran/sink-go/uri"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"github.com/batchstream/sink-go/uri"
"go.mongodb.org/mongo-driver/v2/bson"
"google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc/codes"
Expand Down
4 changes: 2 additions & 2 deletions native_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/batchstream/sink-go/internal/testuri"

sink "github.com/liran/sink-go"
sink "github.com/batchstream/sink-go"
"go.mongodb.org/mongo-driver/v2/bson"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
Expand Down
6 changes: 3 additions & 3 deletions native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"testing"
"time"

"github.com/liran/sink-go/internal/testuri"
"github.com/batchstream/sink-go/internal/testuri"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"go.mongodb.org/mongo-driver/v2/bson"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion proto/sink/sink.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package sink.v1;

option go_package = "github.com/liran/sink-go/api/sink/v1;sinkv1";
option go_package = "github.com/batchstream/sink-go/api/sink/v1;sinkv1";

// Sink provides database-independent record reads and mutations.
//
Expand Down
2 changes: 1 addition & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"unicode/utf8"

sinkv1 "github.com/liran/sink-go/api/sink/v1"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
)

type QueryRequest struct {
Expand Down
4 changes: 2 additions & 2 deletions query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sync/atomic"
"testing"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down
4 changes: 2 additions & 2 deletions request_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package sink_test
import (
"testing"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
)

func TestRequestCompletionDefaultsAndOverridesReachRPC(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion results.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sink
import (
"fmt"

sinkv1 "github.com/liran/sink-go/api/sink/v1"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
)

func decodeReadResult(protoResult *sinkv1.ReadResult, index int) (ReadResult, error) {
Expand Down
4 changes: 2 additions & 2 deletions scan_deadline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
)

type scanDeadlineServer struct {
Expand Down
4 changes: 2 additions & 2 deletions scan_projection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
)

func TestScanProjectionWirePresenceAndValidation(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions scan_retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
4 changes: 2 additions & 2 deletions streaming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"
"time"

sink "github.com/liran/sink-go"
sinkv1 "github.com/liran/sink-go/api/sink/v1"
sink "github.com/batchstream/sink-go"
sinkv1 "github.com/batchstream/sink-go/api/sink/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
Loading
Loading