Documentation
¶
Index ¶
Constants ¶
const HTTPInvalidPayload = errors.Error("HTTPInvalidPayload")
HTTPInvalidPayload is returned by HTTP.Post when it receives an unexpected payload interface.
const MaxBytesPerPayload = 1000 * 1000
MaxBytesPerPayload is the maxmimum size of an aggregated HTTP payload. Substation uses a constant max size of 1MB.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶
type Aggregate struct {
// contains filtered or unexported fields
}
Aggregate stores multiple strings in a newline-delimited payload. This structure can be used when downstream logging systems (e.g., Splunk, Sumo Logic) accept multiple events in a single HTTP POST request.
func (*Aggregate) Add ¶
Add adds string data to the aggregated payload and returns a boolean that describes if the addition was successful. If the method returns false, then the maximum size of the aggregated payload was reached and no more data can be added; if this happens, then the caller must retrieve the aggregated payload, send it to its destination, and create a new Aggregate for storing the failed data.
type HTTP ¶
type HTTP struct {
Client *retryablehttp.Client
}
HTTP wraps a retryable HTTP client.
func (*HTTP) EnableXRay ¶
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".
func (*HTTP) IsEnabled ¶
IsEnabled identifies if the HTTP client is enabled and ready to use. This method can be used for lazy loading the client.