Skip to content

Differences from Go

Daniel Carbone edited this page Nov 6, 2026 · 1 revision

Differences from the Go client

This library aims to behave exactly like the official Go client. This page lists every known place where it doesn't, and why.

Configuration

Area Go client This library
HTTP transport Transport and HttpClient (*http.Client) HttpClient only, any GuzzleHttp\ClientInterface. There is no Transport.
TLS settings Nested TLSConfig struct Flattened onto Config: CAFile, CAPath, CertFile, KeyFile, InsecureSkipVerify, TLSServerName
In-memory PEM TLSConfig.CAPem, CertPEM, KeyPEM Not supported. Use file paths.
TLSServerName Sets the TLS SNI / verification server name Stored and exported by generateEnv(), but not applied: Guzzle has no SNI override. Use a matching Address.
Custom HTTP client + TLS TLSConfig is ignored when you provide your own HttpClient TLS, basic auth and timeout are applied per request, so they take effect with a custom HttpClient too.
Unix sockets (unix://) Works with the standard library Requires ext-curl (CURLOPT_UNIX_SOCKET_PATH). Requests are sent with Host: localhost.
JSON options n/a PHP-only JSONEncodeOpts, JSONDecodeMaxDepth, JSONDecodeOpts

Everything else (defaults, environment variables, address parsing, token precedence, strconv.ParseBool semantics, the InsecureSkipVerify OR rule, and merge behavior) matches api.DefaultConfig() / api.NewClient(). See Configuration.

API shape

  • Return values. Go returns multiple values (val, meta, err). Each PHP method returns a response object that can be destructured the same way ([$val, $qm, $err] = ...). Errors are returned, not thrown. See Responses and Errors.
  • No *Opts variants. Where Go has Foo() and FooOpts(), PHP has a single Foo() with an optional trailing options argument.
  • Named parameters. Models are constructed with PHP named arguments instead of struct literals. See Models.
  • uint64 values (indexes, Flags, etc.) are Brick\Math\BigInteger, because PHP integers are signed 64-bit. See Big Integers.
  • Durations and times are DCarbone\Go\Time\Duration and DCarbone\Go\Time\Time. See Durations and Time.

Not implemented

These parts of the Go client have no PHP equivalent yet:

  • Connect() (Connect CA and intentions endpoints)
  • DiscoveryChain()
  • Internal()
  • Namespaces() and Partitions() (Enterprise). Namespace and Partition are still sent as request parameters.
  • Snapshot()
  • Raw()
  • ExportedServices() and ImportedServices()
  • The LockKey / LockOpts and SemaphorePrefix / SemaphoreOpts helpers

Clone this wiki locally