grpcclient¶
A light, framework-free gRPC client dial factory — build a *grpc.ClientConn from a
plain Target (host, port and go/tls material), with the go/transit client interceptors
passed straight through as dial options.
gitlab.com/phpboyscout/go/grpcclient gives a service or library a gRPC client with
project-standard TLS defaults and no framework in tow. Dial(Target{…}) returns a stock
*grpc.ClientConn: transport credentials are selected from the target's
go/tls pair (insecure when disabled, hardened TLS when
enabled), the endpoint is assembled from host and port, and the caller's dial options are
applied. It is the gRPC client half of the transport stack extracted from
go-tool-base.
What it does¶
- Framework-free. The module requires only the gRPC SDK,
go/tls and
cockroachdb/errors. Adepfootprint_test.goguard forbids go-tool-base, the server stack, and the cloud, CLI and TUI stacks — so a client-only consumer never inherits any of them. - Decoupled Target. The dial factory takes a first-class
Target{Host, Port, TLS}, not a server-settings type, so a client never imports server configuration. - The interceptors are transit's. Circuit breaking and OpenTelemetry instrumentation
are the go/transit gRPC client interceptors; you
pass them to
Dialas ordinarygrpc.DialOptions. Transit is not a dependency of this module — add it to your owngo.modwhen you want it.
What it does not do¶
Dial will not do mutual TLS, will not validate a Target, will not retry, will not pool
connections, and will not stop a caller's dial option from replacing the credentials it
derived. Those are deliberate boundaries or known sharp edges rather than gaps waiting to
be filled — What grpcclient does not do states each one and
what to use instead.
Where next¶
- Dial your first gRPC service —
from
go getto a working call, over plaintext and then TLS. - Dial a service with middleware — wire circuit breaking and OTel via transit interceptors.
- Confirm a connection is actually encrypted — prove which credentials the transport used.
- API reference — every
Targetfield, its default, and what happens when it is wrong. - Errors returned by Dial —
which failures
Dialcatches and which wait for the first RPC. - What grpcclient does not do — the limitations, stated plainly.
- The Target model and the factory split
— how
Dialselects credentials, and why the factory is separate from the middleware. - Godoc — generated API documentation on pkg.go.dev.
Part of the phpboyscout Go toolkit — small, framework-free Go modules extracted from go-tool-base.
Further reading¶
The blog carries a curated route through this subject: Building a web service in Go collects everything written about it, ordered so you can start at the beginning rather than newest-first.
Ask phpbotscout

He answers questions about the projects over on the Discord, citing the docs where they already cover it, and offering to raise an issue where they don't. Bring a bug, an idea, or a questionable engineering decision.