IBM / go-sdk-core

The go-sdk-core repository contains core functionality required by Go code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
30 stars 24 forks source link

feat: add support for gzip compression of request bodies #76

Closed padamstx closed 4 years ago

padamstx commented 4 years ago

Fixes arf/planning-sdk-squad#2185

This commit adds support for peforming gzip compression of request bodies, and consists of the following:

  1. Two new functions: NewGzipCompressionReader() and NewGzipDecompressionReader(). Each function will wrap an existing io.Reader to provide compression/decompression using a filter pattern.

  2. A new field "EnableGzipCompression" was added to the RequestBuilder struct to indicate whether or not request bodies should be gzip-compressed.

  3. RequestBuilder.Build() was updated to honor the new flag and (if enabled) wrap the Body field in a gzip compression filter prior to constructing the http.Request instance.

padamstx commented 4 years ago

Looks good so far but I think a few other things are missing:

* Adding code to have gzip enabled via external config

* At least 1 tests that tests enabling then disabling gzip

haha, thank goodness someone is paying attention... I completely whiffed on the external config requirement. Completely forgot about it :)

padamstx commented 4 years ago

I've added support for external config properties and that also required that I add the EnableGzipCompression flag to the ServiceOptions struct defined in base_service.go (initially I was planning on just adding that to the generated service options struct).

ibm-devx-automation commented 4 years ago

:tada: This PR is included in version 4.6.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: