Skip to content

Releases: dghubble/sling

v1.4.2

26 Feb 01:05
v1.4.2
Compare
Choose a tag to compare

Changes

  • Update Go module dependencies in examples

Contributions

  • Update golang.org/x/net used in examples go.mod by @dghubble in #77
  • Use a centrally managed GitHub Workflow for go tests by @dghubble in #78
  • Allow Go test Workflow to run on PRs by @dghubble in #81
  • Refactored to not use ioutil by @seipan in #84
  • Added Spotify to examples using Sling by @Mahcks in #90
  • Update changelog for new release by @dghubble in #99

Dependencies

  • Bump golang.org/x/oauth2 from 0.5.0 to 0.6.0 in /examples by @dependabot in #79
  • Bump golang.org/x/oauth2 from 0.6.0 to 0.7.0 in /examples by @dependabot in #80
  • Bump golang.org/x/oauth2 from 0.7.0 to 0.8.0 in /examples by @dependabot in #82
  • Bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 in /examples by @dependabot in #83
  • Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 in /examples by @dependabot in #87
  • Bump golang.org/x/oauth2 from 0.10.0 to 0.11.0 in /examples by @dependabot in #91
  • Bump golang.org/x/oauth2 from 0.11.0 to 0.12.0 in /examples by @dependabot in #92
  • Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0 in /examples by @dependabot in #93
  • Bump golang.org/x/net from 0.16.0 to 0.17.0 in /examples by @dependabot in #94
  • Bump golang.org/x/oauth2 from 0.13.0 to 0.14.0 in /examples by @dependabot in #95
  • Bump golang.org/x/oauth2 from 0.14.0 to 0.15.0 in /examples by @dependabot in #96
  • Bump golang.org/x/oauth2 from 0.15.0 to 0.16.0 in /examples by @dependabot in #97
  • Bump golang.org/x/oauth2 from 0.16.0 to 0.17.0 in /examples by @dependabot in #98

New Contributors

Full Changelog: v1.4.1...v1.4.2

v1.4.1

07 Dec 16:43
v1.4.1
Compare
Choose a tag to compare
  • Update minimum Go version from v1.16 to v1.18 (#76)

v1.4.0

02 Oct 18:42
v1.4.0
Compare
Choose a tag to compare
  • Do reads Body to reuse HTTP/1.x "keep-alive" TCP connections (#59)
  • Receive skips decoding if status is 204 (no content) (#63)

v1.3.0

08 Jul 04:12
v1.3.0
Compare
Choose a tag to compare
  • Add Sling ResponseDecoder setter for receiving responses with a custom ResponseDecoder (#49)
  • Add Go module support (i.e. go.mod). Exclude examples (multi-module). (#52)

v1.2.0

18 Nov 08:17
v1.2.0
Compare
Choose a tag to compare
  • Add Connect, Options, and Trace HTTP methods (c51967)
  • Skip receiving (i.e. decoding) 204 No Content responses (#31)

v1.1.0

18 Dec 11:16
v1.1.0
Compare
Choose a tag to compare
  • Allow JSON decoding, regardless of response Content-Type (#26)
  • Add BodyProvider interface and setter so request Body encoding can be customized (#23)
  • Add Doer interface and setter so request sending behavior can be customized (#21)
  • Add SetBasicAuth setter for Authorization headers (#16)
  • Add Sling Body setter to set an io.Reader on the Request (#9)

v1.0.0

23 May 23:47
Compare
Choose a tag to compare
  • Added support for receiving and decoding error JSON structs
  • Renamed Sling JsonBody setter to BodyJSON (breaking)
  • Renamed Sling BodyStruct setter to BodyForm (breaking)
  • Renamed Sling fields httpClient, method, rawURL, and header to be internal (breaking)
  • Changed Do and Receive to skip response JSON decoding if "application/json" Content-Type is missing
  • Changed Sling.Receive(v interface{}) to Sling.Receive(successV, failureV interface{}) (breaking)
    • Previously Receive attempted to decode the response Body in all cases
    • Updated Receive will decode the response Body into successV for 2XX responses or decode the Body into failureV for other status codes. Pass a nil successV or failureV to skip JSON decoding into that value.
    • To upgrade, pass nil for the failureV argument or consider defining a JSON tagged struct appropriate for the API endpoint. (e.g. s.Receive(&issue, nil), s.Receive(&issue, &githubError))
    • To retain the old behavior, duplicate the first argument (e.g. s.Receive(&tweet, &tweet))
  • Changed Sling.Do(http.Request, v interface{}) to Sling.Do(http.Request, successV, failureV interface{}) (breaking)
    • See the changelog entry about Receive, the upgrade path is the same.
  • Removed HEAD, GET, POST, PUT, PATCH, DELETE constants, no reason to export them (breaking)

v0.4.0

23 May 23:48
Compare
Choose a tag to compare
  • Improved golint compliance
  • Fixed typos and test printouts

v0.3.0

23 May 23:49
Compare
Choose a tag to compare
  • Added BodyStruct method for setting a url encoded form body on the Request
  • Added Add and Set methods for adding or setting Request Headers
  • Added JsonBody method for setting JSON Request Body
  • Improved examples and documentation

v0.2.0

23 May 23:50
Compare
Choose a tag to compare
  • Added http.Client setter
  • Added Sling.New() method to return a copy of a Sling
  • Added Base setter and Path extension support
  • Added method setters (Get, Post, Put, Patch, Delete, Head)
  • Added support for encoding URL Query parameters
  • Added example tiny Github API
  • Changed v0.1.0 method signatures and names (breaking)
  • Removed Go 1.0 support