Lattice Hub Docs
GuidesThin SDK

Go Thin SDK

Install pole-client-go and use Sidecar Session / TargetService with the official Go module.

The Go Thin SDK (pole-client-go) is a framework-independent contract core. It opens a Sidecar Session over UDS, receives local listeners, and encodes TargetService v1 metadata.

Official package

ItemValue
Repositorygithub.com/lattice-hub/pole-client-go
Go modulegithub.com/lattice-hub/pole-client-go
Installgo get github.com/lattice-hub/pole-client-go
RequirementsGo 1.22+; shared UDS with Sidecar

Install

go get github.com/lattice-hub/pole-client-go

In go.mod:

require github.com/lattice-hub/pole-client-go v0.0.0-20260802050415-168166bbae61

If the module proxy has not cached it yet:

git clone https://github.com/lattice-hub/pole-client-go.git
cd pole-client-go && go test ./...

Minimal usage

Default bootstrap: /var/run/pole/sidecar/bootstrap.sock. Override with BootstrapConfig.SocketPath or POLE_SIDECAR_SOCKET.

client, err := pole.NewSidecarClient(ctx, pole.BootstrapConfig{
	SDKVersion: "1.0.0",
})
if err != nil {
	return err
}
defer client.Close()

httpAddress, err := client.ListenerAddress(pole.ProtocolHTTP)
if err != nil {
	return err
}

target, err := pole.NewTargetService("default", "orders")
if err != nil {
	return err
}

request, err := http.NewRequest(http.MethodGet, "http://"+httpAddress+"/orders/42", nil)
if err != nil {
	return err
}
request.Header, err = target.EncodeHTTPHeaders(request.Header)

httpAddress is the Sidecar loopback 127.0.0.1:port, not a real instance address. Do not cache listeners; the SDK invalidates the snapshot when the session drops.

Metadata

The SDK writes and overwrites these keys:

latticehub-target-namespace
latticehub-target-service
  • HTTP / Thrift-over-HTTP: EncodeHTTPHeaders
  • gRPC: EncodeGRPCMetadata
  • Dubbo: EncodeAttachments

Boundary

  • No framework adapters
  • End-to-end Sidecar compatibility is still evolving—see the Thin SDK overview

Next

On this page