Skip to content

Commit 0d7819a

Browse files
committed
Refactor logger.BuildLogger function to include LogExportPath field in ClientOptions struct
1 parent 4a999ba commit 0d7819a

File tree

5 files changed

+23
-115
lines changed

5 files changed

+23
-115
lines changed

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ Currently, the HTTP client supports the following API handlers:
3333

3434
## Getting Started
3535

36+
## HTTP Client Build Flow
37+
38+
The HTTP client build flow can be initiated using a number of methods. The primary methods include:
39+
40+
Using the SDK `BuildClientWithConfigFile` function, which reads the configuration from a JSON file and constructs the client accordingly. The configuration file specifies the authentication details, API environment settings, and client options, such as logging level, retry attempts, and concurrency limits.
41+
42+
Or using the SDK `BuildClientWithEnvironmentVariables` function, which reads the configuration from environment variables and constructs the client accordingly. This method allows for more flexible configuration management, particularly in containerized environments or when using orchestration tools.
43+
44+
There is also the option to the build the client manually by creating a new `Client` struct and setting the required fields directly. This method provides the most granular control over the client configuration and can be useful for advanced use cases or when integrating with existing configuration management systems. This is the approached used in related terraform providers.
45+
46+
![HTTP Client Build Flow](docs/media/BuildClient.png)
47+
3648
### Installation
3749

3850
To use this HTTP client in your project, add the package to your Go module dependencies:
@@ -42,7 +54,8 @@ go get github.com/yourusername/go-api-http-client
4254
```
4355

4456
### Usage
45-
Example usage with a configuration file:
57+
58+
Example usage with a configuration file using the jamfpro SDK client builder function:
4659

4760
```go
4861
package main
@@ -84,23 +97,21 @@ Example configuration file (clientconfig.json):
8497
"APIType": "" // "jamfpro" / "graph"
8598
},
8699
"ClientOptions": {
87-
"LogLevel": "LogLevelDebug", // "LogLevelDebug" / "LogLevelInfo" / "LogLevelWarn" / "LogLevelError" / "LogLevelFatal" / "LogLevelPanic"
100+
"LogLevel": "LogLevelDebug", // "LogLevelDebug" / "LogLevelInfo" / "LogLevelWarn" / "LogLevelError" / "LogLevelFatal" / "LogLevelPanic"
88101
"LogOutputFormat": "console", // "console" / "json"
89-
"LogConsoleSeparator": " ", // " " / "\t" / "," / etc.
90-
"HideSensitiveData": true, // true / false
91-
"EnableDynamicRateLimiting": true, // true / false
92-
"MaxRetryAttempts": 5,
93-
"MaxConcurrentRequests": 3,
94-
"EnableCookieJar": true // true / false
102+
"LogConsoleSeparator": " ", // " " / "\t" / "," / etc.
103+
"LogExportPath": "/path/to/export/your/logs",
104+
"HideSensitiveData": true, // redacts sensitive data from logs
105+
"MaxRetryAttempts": 5, // set number of retry attempts
106+
"MaxConcurrentRequests": 3, // set number of concurrent requests
107+
"EnableCookieJar": false, // enable cookie jar support
108+
"FollowRedirects": true, // follow redirects
109+
"MaxRedirects": 5 // set number of redirects to follow
95110
}
96111
}
97112
```
98113

99-
## Status
100-
101-
[![Super Linter](<https://github.com/segraef/Template/actions/workflows/linter.yml/badge.svg>)](<https://github.com/segraef/Template/actions/workflows/linter.yml>)
102114

103-
[![Sample Workflow](<https://github.com/segraef/Template/actions/workflows/workflow.yml/badge.svg>)](<https://github.com/segraef/Template/actions/workflows/workflow.yml>)
104115

105116

106117
## Reporting Issues and Feedback

docs/markdown-syntax-guide.md

Lines changed: 0 additions & 103 deletions
This file was deleted.

docs/media/BuildClient.png

157 KB
Loading

docs/media/MicrosoftAzure-32px.png

-1020 Bytes
Binary file not shown.
-1.56 KB
Binary file not shown.

0 commit comments

Comments
 (0)