Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

SDK transport interface: decouple from gRPC #160

@zeevdr

Description

@zeevdr

Description

Introduce a transport interface in the SDK so consumers aren't forced into a specific gRPC version. The SDK currently takes grpc.ClientConnInterface directly, coupling consumers to our pinned gRPC version (v1.79.3, requires Go 1.24).

Approach

Define a transport interface per SDK module:

type Transport interface {
    GetConfig(ctx context.Context, req *GetConfigRequest) (*GetConfigResponse, error)
    // ...
}

type GRPCTransport struct { conn grpc.ClientConnInterface }

gRPC becomes an implementation detail in a separate sub-module (sdk/grpctransport or similar). Consumers can bring their own gRPC version or a non-gRPC transport.

Module structure after this change

sdk/configclient/     → go 1.22, no gRPC dependency
sdk/adminclient/      → go 1.22, no gRPC dependency
sdk/configwatcher/    → go 1.22, depends on configclient interface
sdk/grpctransport/    → go 1.24+, depends on gRPC, implements transport interfaces
sdk/tools/            → unchanged

Acceptance criteria

  • Transport interface defined in configclient and adminclient
  • GRPCTransport as default implementation in sdk/grpctransport
  • Existing New(conn) convenience API preserved (in grpctransport)
  • configwatcher uses configclient's interface, not gRPC directly
  • All tests pass
  • Migration guide in SDK README

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    size: MModerate — a day or two, clear scope

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions