Repository navigation
Differences from Go
Daniel Carbone edited this page Nov 6, 2026
·
1 revision
This library aims to behave exactly like the official Go client. This page lists every known place where it doesn't, and why.
| 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.
-
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
*Optsvariants. Where Go hasFoo()andFooOpts(), PHP has a singleFoo()with an optional trailing options argument. - Named parameters. Models are constructed with PHP named arguments instead of struct literals. See Models.
-
uint64values (indexes,Flags, etc.) areBrick\Math\BigInteger, because PHP integers are signed 64-bit. See Big Integers. -
Durations and times are
DCarbone\Go\Time\DurationandDCarbone\Go\Time\Time. See Durations and Time.
These parts of the Go client have no PHP equivalent yet:
-
Connect()(Connect CA and intentions endpoints) DiscoveryChain()Internal()-
Namespaces()andPartitions()(Enterprise).NamespaceandPartitionare still sent as request parameters. Snapshot()Raw()-
ExportedServices()andImportedServices() - The
LockKey/LockOptsandSemaphorePrefix/SemaphoreOptshelpers