Problem
The generated achievement client currently uses TransportConfig for HTTP
client configuration:
client := achievementclient.NewHTTPClientWithConfig(
strfmt.Default,
&achievementclient.TransportConfig{
Host: "demo.accelbyte.io",
BasePath: "/api/v1",
Schemes: []string{"https"},
},
)
This requires callers to construct and manage a configuration struct even when only a small number of options need to be customized.
Proposed improvement
Introduce functional options for configuring the HTTP client:
client := achievementclient.NewHTTPClient(
strfmt.Default,
achievementclient.WithHost("demo.accelbyte.io"),
achievementclient.WithBasePath("/api/v1"),
achievementclient.WithSchemes([]string{"https"}),
)
Proposed options:
- WithHost
- WithBasePath
- WithSchemes
- WithUserAgent
Problem
The generated achievement client currently uses
TransportConfigfor HTTPclient configuration:
This requires callers to construct and manage a configuration struct even when only a small number of options need to be customized.
Proposed improvement
Introduce functional options for configuring the HTTP client:
Proposed options: