Skip to content

Commit e04978c

Browse files
authored
Merge pull request #247 from deploymenttheory/dev-dw-general
updated docs for refactor changes
2 parents 89cdd8c + a3b6200 commit e04978c

File tree

2 files changed

+22
-49
lines changed

2 files changed

+22
-49
lines changed

README.md

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
This Go module offers a sophisticated HTTP client designed for seamless API interactions, with a strong emphasis on concurrency management, robust error handling, extensive logging, and adaptive rate limiting. It's particularly suitable for applications requiring high-throughput API interactions with complex authentication and operational resilience.
44

5-
This client leverages API-specific SDKs to provide a comprehensive and consistent interface for interacting with various APIs, including Microsoft Graph, Jamf Pro, and others. It is designed to be easily extensible to support additional APIs and to be highly configurable to meet specific API requirements. It achieves this through using a modular design, with a core HTTP client and API-specific handlers that encapsulate the unique requirements of each API supported.
5+
This client is designed to be used with targetted SDK's and terraform providers only. As such the http client cannot be used without a supporting SDK and associated api integration plugin [go-api-http-client-integrations](https://github.com/deploymenttheory/go-api-http-client-integrations).
66

7-
This HTTP client is intended to be used with targetted SDK's and terraform providers only. As such the http client cannot be used without a supporting SDK.
7+
The plugin is required to provide the necessary API-specific handlers and configuration to the HTTP client. The plugin approach is designed to provide a consistent interface for interacting with various APIs, including Microsoft Graph, Jamf Pro, and others. It is easily extensible to support additional APIs and highly configurable to meet specific API requirements. It achieves this through using a modular design, with a core HTTP client and API-specific handlers that encapsulate the unique requirements of each API supported. Conseqently the client provides core common HTTP client functionality, such as rate limiting, logging, concurrency and responses while the plugin provides the API-specific logic, such as encoding and decoding requests, managing authentication endpoints, and handling API-specific logic.
88

9-
## Features
9+
## HTTP Client Features
1010

1111
- **Comprehensive Authentication Support**: Robust support for various authentication schemes, including OAuth and Bearer Token, with built-in token management and validation.
1212
- **Advanced Concurrency Management**: An intelligent Concurrency Manager dynamically adjusts concurrent request limits to optimize throughput and adhere to API rate limits.
@@ -20,42 +20,19 @@ This HTTP client is intended to be used with targetted SDK's and terraform provi
2020
- **API Handler Interface**: Provides a flexible and extensible way to interact with different APIs, including encoding and decoding requests and responses, managing authentication endpoints, and handling API-specific logic.
2121
- **Configuration via JSON or Environment Variables**: The Go API HTTP Client supports configuration via JSON files or environment variables, providing flexibility in defining authentication credentials, API endpoints, logging settings, and other parameters.
2222

23-
TBC
24-
2523
## Getting Started
26-
'
27-
{
28-
"Integration": {
29-
"FQDN": "https://api.example.com",
30-
"AuthMethodDescriptor": "Bearer"
31-
// other necessary fields for integration
32-
},
33-
"HideSensitiveData": true,
34-
"CustomCookies": [
35-
{
36-
"Name": "sessionid",
37-
"Value": "abc123",
38-
"Path": "/",
39-
"Domain": "example.com",
40-
"Expires": "2025-01-02T15:04:05Z",
41-
"MaxAge": 86400,
42-
"Secure": true,
43-
"HttpOnly": true,
44-
"SameSite": 1
45-
}
46-
],
47-
"MaxRetryAttempts": 5,
48-
"MaxConcurrentRequests": 10,
49-
"EnableDynamicRateLimiting": true,
50-
"CustomTimeout": "10s",
51-
"TokenRefreshBufferPeriod": "2m",
52-
"TotalRetryDuration": "10m",
53-
"FollowRedirects": true,
54-
"MaxRedirects": 3,
55-
"ConcurrencyManagementEnabled": true
56-
}
57-
'
5824

25+
This SDK requires an existing Go environment to build and run. If you do not have Go installed, you can download and install it from the [official Go website](https://golang.org/doc/install).
26+
27+
28+
29+
## SDK Support
30+
31+
This http client is used in conjuction with the following SDKs:
32+
33+
- [go-api-sdk-m365](https://github.com/deploymenttheory/go-api-sdk-m365)
34+
35+
- [go-api-sdk-jamfpro](https://github.com/deploymenttheory/go-api-sdk-jamfpro)
5936

6037
## Reporting Issues and Feedback
6138

@@ -75,10 +52,6 @@ If you would like to become an active contributor to this repository or project,
7552

7653
## Learn More
7754

78-
* [GitHub Documentation][GitHubDocs]
79-
* [Azure DevOps Documentation][AzureDevOpsDocs]
80-
* [Microsoft Azure Documentation][MicrosoftAzureDocs]
81-
8255
<!-- References -->
8356

8457
<!-- Local -->

httpclient/client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ type Client struct {
3636
// Options/Variables for Client
3737
type ClientConfig struct {
3838
Integration APIIntegration
39-
HideSensitiveData bool
39+
HideSensitiveData bool `json:"hide_sensitive_data"`
4040
CustomCookies []*http.Cookie
41-
MaxRetryAttempts int
42-
MaxConcurrentRequests int
43-
EnableDynamicRateLimiting bool
41+
MaxRetryAttempts int `json:"max_retry_attempts"`
42+
MaxConcurrentRequests int `json:"max_concurrent_requests"`
43+
EnableDynamicRateLimiting bool `json:"enable_dynamic_rate_limiting"`
4444
CustomTimeout time.Duration
4545
TokenRefreshBufferPeriod time.Duration
46-
TotalRetryDuration time.Duration // TODO do we need this now it's in the integration?
47-
FollowRedirects bool
48-
MaxRedirects int
49-
EnableConcurrencyManagement bool
46+
TotalRetryDuration time.Duration
47+
FollowRedirects bool `json:"follow_redirects"`
48+
MaxRedirects int `json:"max_redirects"`
49+
EnableConcurrencyManagement bool `json:"enable_concurrency_management"`
5050
}
5151

5252
// BuildClient creates a new HTTP client with the provided configuration.

0 commit comments

Comments
 (0)