The highest tagged major version is
v2 .
Discover Packages
github.com/brexhq/substation
internal
http
package
Version:
v0.8.1
Opens a new window with list of versions in this module.
Published: Jan 10, 2023
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
http
Contains functions for managing HTTP requests. Substation follows these rules across every application:
HTTP clients are always retryable clients from this package
For AWS deployments, HTTP clients enable AWS X-Ray
Expand ▾
Collapse ▴
Documentation
¶
type HTTP struct {
Client *retryablehttp.Client
}
HTTP wraps a retryable HTTP client.
func (h *HTTP ) EnableXRay()
EnableXRay replaces the standard retryable HTTP client with an AWS XRay client. This method can be used when making HTTP calls on AWS infrastructure and should be enabled by looking for the environment variable "AWS_XRAY_DAEMON_ADDRESS".
Get is a context-aware convenience function for making GET requests.
IsEnabled identifies if the HTTP client is enabled and ready to use. This method can be used for lazy loading the client.
Post is a context-aware convenience function for making POST requests. This method optionally supports custom headers.
Setup creates a retryable HTTP client.
Header contains a single HTTP header that can be passed to HTTP.Post. Multiple headers can be passed to HTTP.Post as a slice.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.