GumpacG opened a new pull request, #3467: URL: https://github.com/apache/tinkerpop/pull/3467
# Standardize `gremlin-go` connection options Implements the Go portion of the TinkerPop 4.x GLV connection-options standardization. Renames several settings fields to canonical names, moves the authentication helpers into a dedicated `auth` sub-package (flat functions kept as deprecated delegators), aligns defaults, adds new options, and fixes a silent proxy drop. Go driver changes only; the other GLVs follow in separate PRs. **Proposal:** https://lists.apache.org/thread/yqtr2wnb1kq2pqqq4002cz511q5o0bkg ## Renames (breaking) Struct fields cannot be aliased, so these are hard renames and existing code must be updated. | Old | New | Default | | ------------------------------ | ---------------- | ------- | | `MaximumConcurrentConnections` | `MaxConnections` | 128 | | `IdleConnectionTimeout` | `IdleTimeout` | 180s | | `KeepAliveInterval` | `KeepAliveTime` | 30s | | `ConnectionTimeout` | `ConnectTimeout` | 5s | | `TlsConfig` (`*tls.Config`) | `Ssl` | - | | `RequestInterceptors` | `Interceptors` | - | | `EnableCompression` | `Compression` | - | Auth helpers moved out of package `gremlingo` into a new `auth` sub-package (`github.com/apache/tinkerpop/gremlin-go/v4/driver/auth`): | Old | New | | -------------------------- | --------------------------- | | `BasicAuth` | `auth.Basic` | | `SigV4Auth` | `auth.SigV4` | | `SigV4AuthWithCredentials` | `auth.SigV4WithCredentials` | The flat `gremlingo` auth functions are retained as deprecated delegators (idiomatic Go `// Deprecated:` doc comments) so existing code keeps compiling. New code should use the `auth` sub-package. ## Behavior changes (breaking) - **`Compression`** is now a typed `Compression` const (`gremlingo.CompressionNone`/`gremlingo.CompressionDeflate`) and defaults to `CompressionDeflate` (on); the driver sends `Accept-Encoding: deflate` by default. Set `gremlingo.CompressionNone` to disable. The manual per-chunk deflate decode path is retained. - **`http.Transport.Proxy`** now defaults to `http.ProxyFromEnvironment`, so `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY` are honored. The custom transport previously left `Proxy` unset, silently dropping any environment proxy configuration. ## New options - **`ReadTimeout`** (default 0, off) - a per-read idle timeout reset on each read of the response body and re-armed across pooled-connection reuse, so it never fires while a pooled connection is idle between requests. - **`MaxResponseHeaderBytes`** - exposes `http.Transport.MaxResponseHeaderBytes` (native bytes). - **`Proxy`** - an explicit proxy override for the transport. - **`DefaultBatchSize`** (64) - connection-level default that fills a request's `batchSize` when unset. The Go-specific **`MaxIdleConnections`** (count-based idle keep-alive cap, default 8) is unchanged. ## Removed (breaking) - **`MaxResponseContentLength`** - responses now stream; `ReadTimeout` is the partial mitigation. ## Testing - `gremlin-go` `go build ./...` and `go vet ./...` pass. - Unit tests pass, including the relocated auth tests: `auth.TestBasic`/`auth.TestSigV4` in the new `auth` sub-package, and `TestDeprecatedBasicAuth`/`TestDeprecatedSigV4Auth` covering the deprecated delegators. - CHANGELOG, reference config table (`gremlin-variants.asciidoc`), and upgrade guide (`release-4.x.x.asciidoc`) updated for the Go slice. Assisted-by: Kiro: Claude Opus 4.8 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
