diff --git a/.github/coverage-minimums.json b/.github/coverage-minimums.json index 4bbc593..5421d6e 100644 --- a/.github/coverage-minimums.json +++ b/.github/coverage-minimums.json @@ -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 } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9c71df..40f0999 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ 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}" @@ -92,7 +92,7 @@ jobs: - 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 }} @@ -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 diff --git a/Makefile b/Makefile index 90390a0..aa3561f 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index bbaa65c..093cdca 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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::`. The builder escapes each path segment; encoded slashes are part of a segment. Alternate URI spellings, @@ -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" ) @@ -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 @@ -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 @@ -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. @@ -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 diff --git a/api/sink/v1/sink.pb.go b/api/sink/v1/sink.pb.go index 9c34b95..bcf3766 100644 --- a/api/sink/v1/sink.pb.go +++ b/api/sink/v1/sink.pb.go @@ -2407,7 +2407,7 @@ const file_sink_sink_proto_rawDesc = "" + "\aExecute\x12\x17.sink.v1.ExecuteRequest\x1a\x18.sink.v1.ExecuteResponse\x128\n" + "\x05Query\x12\x15.sink.v1.QueryRequest\x1a\x16.sink.v1.QueryResponse0\x01\x126\n" + "\x05Count\x12\x15.sink.v1.CountRequest\x1a\x16.sink.v1.CountResponse\x125\n" + - "\x04Scan\x12\x14.sink.v1.ScanRequest\x1a\x15.sink.v1.ScanResponse0\x01B-Z+github.com/liran/sink-go/api/sink/v1;sinkv1b\x06proto3" + "\x04Scan\x12\x14.sink.v1.ScanRequest\x1a\x15.sink.v1.ScanResponse0\x01B3Z1github.com/batchstream/sink-go/api/sink/v1;sinkv1b\x06proto3" var ( file_sink_sink_proto_rawDescOnce sync.Once diff --git a/balancing_test.go b/balancing_test.go index 1f8b070..2fc5f19 100644 --- a/balancing_test.go +++ b/balancing_test.go @@ -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" diff --git a/client.go b/client.go index cdc8310..cb16a8f 100644 --- a/client.go +++ b/client.go @@ -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" diff --git a/client_test.go b/client_test.go index 729ca44..6d3b4fb 100644 --- a/client_test.go +++ b/client_test.go @@ -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" diff --git a/contract_test.go b/contract_test.go index b381a5f..4aba311 100644 --- a/contract_test.go +++ b/contract_test.go @@ -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" ) diff --git a/dataset.go b/dataset.go index a11b8e8..fbe74f2 100644 --- a/dataset.go +++ b/dataset.go @@ -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 diff --git a/dataset_native_test.go b/dataset_native_test.go index f426849..eb91442 100644 --- a/dataset_native_test.go +++ b/dataset_native_test.go @@ -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" ) diff --git a/dataset_test.go b/dataset_test.go index 2d476fb..7a3ed6b 100644 --- a/dataset_test.go +++ b/dataset_test.go @@ -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" diff --git a/dns_balancing_integration_test.go b/dns_balancing_integration_test.go index 9af9ba2..c5d8a58 100644 --- a/dns_balancing_integration_test.go +++ b/dns_balancing_integration_test.go @@ -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" diff --git a/go.mod b/go.mod index 8e0e4ce..1787363 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/liran/sink-go +module github.com/batchstream/sink-go go 1.27.0 diff --git a/integration_test.go b/integration_test.go index ad22280..a71fa2b 100644 --- a/integration_test.go +++ b/integration_test.go @@ -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" ) diff --git a/internal/testuri/uri.go b/internal/testuri/uri.go index 2f6eec4..bb0f284 100644 --- a/internal/testuri/uri.go +++ b/internal/testuri/uri.go @@ -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) diff --git a/native.go b/native.go index 38b3cb9..563c5b0 100644 --- a/native.go +++ b/native.go @@ -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" diff --git a/native_integration_test.go b/native_integration_test.go index 50baf48..77fca22 100644 --- a/native_integration_test.go +++ b/native_integration_test.go @@ -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" diff --git a/native_test.go b/native_test.go index 172ba51..a2a58c8 100644 --- a/native_test.go +++ b/native_test.go @@ -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" diff --git a/proto/sink/sink.proto b/proto/sink/sink.proto index e72addc..5b799c8 100644 --- a/proto/sink/sink.proto +++ b/proto/sink/sink.proto @@ -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. // diff --git a/query.go b/query.go index dc4d226..ea90fc5 100644 --- a/query.go +++ b/query.go @@ -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 { diff --git a/query_test.go b/query_test.go index dc52cec..81d6579 100644 --- a/query_test.go +++ b/query_test.go @@ -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" ) diff --git a/request_helpers_test.go b/request_helpers_test.go index 0b2a937..e253107 100644 --- a/request_helpers_test.go +++ b/request_helpers_test.go @@ -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) { diff --git a/results.go b/results.go index 756c149..13ef244 100644 --- a/results.go +++ b/results.go @@ -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) { diff --git a/scan_deadline_test.go b/scan_deadline_test.go index 118d907..3c4df93 100644 --- a/scan_deadline_test.go +++ b/scan_deadline_test.go @@ -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 { diff --git a/scan_projection_test.go b/scan_projection_test.go index 1089e9f..d90832a 100644 --- a/scan_projection_test.go +++ b/scan_projection_test.go @@ -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) { diff --git a/scan_retry_test.go b/scan_retry_test.go index f68e3f1..00a9cd0 100644 --- a/scan_retry_test.go +++ b/scan_retry_test.go @@ -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" diff --git a/streaming_test.go b/streaming_test.go index 7889bed..11e3910 100644 --- a/streaming_test.go +++ b/streaming_test.go @@ -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" diff --git a/types.go b/types.go index 222d234..4b1ad0e 100644 --- a/types.go +++ b/types.go @@ -8,9 +8,9 @@ import ( "errors" "fmt" - "github.com/liran/sink-go/uri" + "github.com/batchstream/sink-go/uri" - sinkv1 "github.com/liran/sink-go/api/sink/v1" + sinkv1 "github.com/batchstream/sink-go/api/sink/v1" "go.mongodb.org/mongo-driver/v2/bson" ) diff --git a/vtproto_test.go b/vtproto_test.go index 3c8bdf1..ca66302 100644 --- a/vtproto_test.go +++ b/vtproto_test.go @@ -3,10 +3,10 @@ package sink import ( "testing" - "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" - 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/encoding" ) diff --git a/wire.go b/wire.go index dfdc1a8..221bad0 100644 --- a/wire.go +++ b/wire.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - sinkv1 "github.com/liran/sink-go/api/sink/v1" + sinkv1 "github.com/batchstream/sink-go/api/sink/v1" ) func (a Address) toProto() *sinkv1.RecordAddress {