File: customizations.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.49.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312,636 kB
  • sloc: makefile: 120
file content (19 lines) | stat: -rw-r--r-- 805 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package cloudwatch

import (
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/internal/encoding/gzip"
)

// WithGzipRequest is a request.Option that adds a request handler to the Build
// stage of the operation's pipeline that will content-encoding GZIP the
// request payload before sending it to the API. This will buffer the request
// payload in memory, GZIP it, and reassign the GZIP'ed payload as the new
// request payload.
//
// GZIP may not be supported by all API operations. See API's documentation for
// the operation your using to see if GZIP request payload is supported.
// https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html
func WithGzipRequest(r *request.Request) {
	r.Handlers.Build.PushBackNamed(gzip.NewGzipRequestHandler())
}