Skip to content

Add configurable HTTP client to Loginradius struct#10

Open
sanjayjohn wants to merge 1 commit intoLoginRadius:masterfrom
sanjayjohn:dev
Open

Add configurable HTTP client to Loginradius struct#10
sanjayjohn wants to merge 1 commit intoLoginRadius:masterfrom
sanjayjohn:dev

Conversation

@sanjayjohn
Copy link
Copy Markdown

Summary

  • Added HTTPRClient *httprutils.Client field to the Loginradius struct, enabling consumers to inject a custom HTTP client
  • Replaced all 157 occurrences of httprutils.TimeoutClient.Send(...) with lr.Client.HTTPRClient.Send(...) across 22 API files
  • Backward compatible: NewLoginradius() defaults HTTPRClient to httprutils.TimeoutClient

Usage

lrclient, _ := lr.NewLoginradius(&cfg)
// Optionally inject a custom HTTP client:
lrclient.HTTPRClient = &httprutils.Client{HTTPClient: customHTTPClient}

Replace all hardcoded httprutils.TimeoutClient.Send() calls
with lr.Client.HTTPRClient.Send(), allowing consumers to inject a custom
HTTP client. Defaults to httprutils.TimeoutClient for backward compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant