Documentation ¶
Index ¶
- func LogAfterResponse(r *resty.Client, response *resty.Response) error
- func LogBeforeRequest(_ *resty.Client, request *resty.Request) error
- func LogError(message, directory, function string, error error, args ...any)
- func LogInfo(message, directory, function string, error error, args ...any)
- func LogRequest(uuid, method, url, body string, request, headers any)
- func LogResponse(uuid, status, body, method, url string, headers any)
- func LogWarn(message, directory, function string, error error, args ...any)
- func NewHTTPClient() *httpClient
- type ContextKey
- type HTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogAfterResponse ¶
func LogAfterResponse(r *resty.Client, response *resty.Response) error
LogAfterResponse is a resty callback that logs the response of the request it uses the request context to get the requestID to sign the log and make easy to track the request in the logs
func LogBeforeRequest ¶
func LogBeforeRequest(_ *resty.Client, request *resty.Request) error
LogBeforeRequest is a resty callback that logs the request before it is sent it uses the request context to set the requestID to sign the log and make easy to track the request in the logs
func LogRequest ¶
func LogResponse ¶
func NewHTTPClient ¶
func NewHTTPClient() *httpClient
NewHTTPClient returns a new instance of httpClient
Types ¶
type ContextKey ¶
type ContextKey string
const ( LogHttpClient = "shared/httpclient.go" RequestUUID ContextKey = "request_uuid" )
Click to show internal directories.
Click to hide internal directories.