Problem
The internal rawClient interface is unexported:
type rawClient interface {
doRequest(ctx context.Context, workerID int) (int, error)
close()
}
Users cannot implement custom protocol handlers (gRPC, QUIC, WebSocket) to use with the benchmarker.
Solution
Export the interface as Client:
// Client is the interface for protocol-specific benchmark clients.
// Implement this interface to add support for custom protocols.
type Client interface {
// DoRequest sends a single request and returns the response status code.
DoRequest(ctx context.Context, workerID int) (int, error)
// Close releases all resources held by the client.
Close()
}
- Rename internal usages from
rawClient to Client
- Add
Config.Client Client field for user-provided implementations
- When
Config.Client is set, skip built-in H1/H2 client creation
Acceptance Criteria
Breaking Change
Renames internal interface. No external breakage since interface was unexported, but the new Config.Client field is additive.
Problem
The internal
rawClientinterface is unexported:Users cannot implement custom protocol handlers (gRPC, QUIC, WebSocket) to use with the benchmarker.
Solution
Export the interface as
Client:rawClienttoClientConfig.Client Clientfield for user-provided implementationsConfig.Clientis set, skip built-in H1/H2 client creationAcceptance Criteria
Clientinterface is exportedConfig.Clientfield allows custom implementationsClientBreaking Change
Renames internal interface. No external breakage since interface was unexported, but the new
Config.Clientfield is additive.