From 0c9388b43e23016032dee14bb9f8c54fb41b12f2 Mon Sep 17 00:00:00 2001
From: Jeevanandam M
Date: Sun, 24 Oct 2021 17:10:09 -0700
Subject: [PATCH 1/3] Added SetBaseURL method deprecated SetHostURL, to be
removed in next major release #441
---
client.go | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/client.go b/client.go
index f68d0547..eb12f086 100644
--- a/client.go
+++ b/client.go
@@ -92,7 +92,8 @@ type (
// Resty also provides an options to override most of the client settings
// at request level.
type Client struct {
- HostURL string
+ BaseURL string
+ HostURL string // Deprecated: use BaseURL instead. To be removed in v3.0.0 release.
QueryParam url.Values
FormData url.Values
Header http.Header
@@ -154,8 +155,25 @@ type User struct {
//
// // Setting HTTPS address
// client.SetHostURL("https://myjeeva.com")
+//
+// Deprecated: use SetBaseURL instead. To be removed in v3.0.0 release.
func (c *Client) SetHostURL(url string) *Client {
- c.HostURL = strings.TrimRight(url, "/")
+ c.SetBaseURL(url)
+ return c
+}
+
+// SetBaseURL method is to set Base URL in the client instance. It will be used with request
+// raised from this client with relative URL
+// // Setting HTTP address
+// client.SetBaseURL("http://myjeeva.com")
+//
+// // Setting HTTPS address
+// client.SetBaseURL("https://myjeeva.com")
+//
+// Since v2.7.0
+func (c *Client) SetBaseURL(url string) *Client {
+ c.BaseURL = strings.TrimRight(url, "/")
+ c.HostURL = c.BaseURL
return c
}
From 5e137527d53febe4f2ddc83390ea95e7e5145c9d Mon Sep 17 00:00:00 2001
From: Jeevanandam M
Date: Sun, 24 Oct 2021 17:13:33 -0700
Subject: [PATCH 2/3] Godoc update for #436
---
request.go | 2 ++
1 file changed, 2 insertions(+)
diff --git a/request.go b/request.go
index 52166e69..1cd42cf7 100644
--- a/request.go
+++ b/request.go
@@ -599,6 +599,8 @@ func (r *Request) SetCookies(rs []*http.Cookie) *Request {
// The request will retry if any of the functions return true and error is nil.
//
// Note: These retry conditions are checked before all retry conditions of the client.
+//
+// Since v2.7.0
func (r *Request) AddRetryCondition(condition RetryConditionFunc) *Request {
r.retryConditions = append(r.retryConditions, condition)
return r
From 9e8f2ba9a84ddec42c1036b9a355a0b6b3643ecd Mon Sep 17 00:00:00 2001
From: Jeevanandam M
Date: Sun, 24 Oct 2021 22:12:53 -0700
Subject: [PATCH 3/3] Adding github actions and removing travis ci #479
---
.github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++
.travis.yml | 18 ------------------
README.md | 2 +-
3 files changed, 42 insertions(+), 19 deletions(-)
create mode 100644 .github/workflows/ci.yml
delete mode 100644 .travis.yml
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..13b025b6
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,41 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - master
+ paths-ignore:
+ - '**.md'
+ pull_request:
+ branches:
+ - master
+ paths-ignore:
+ - '**.md'
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+jobs:
+ build:
+ name: Build
+ strategy:
+ matrix:
+ go: [ '1.17.x', '1.16.x' ]
+ os: [ ubuntu-latest ]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Setup Go
+ uses: actions/setup-go@v2
+ with:
+ go-version: ${{ matrix.go }}
+
+ - name: Test
+ run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic
+
+ - name: Coverage
+ run: bash <(curl -s https://codecov.io/bash)
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index d6f15f85..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-language: go
-
-os: linux
-
-if: (branch = master) OR (type = pull_request)
-
-go: # use travis ci resource effectively, keep always latest 2 versions
- - 1.17.x
- - 1.16.x
-
-install:
- - go get -v -t ./...
-
-script:
- - go test ./... -race -coverprofile=coverage.txt -covermode=atomic
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/README.md b/README.md
index 2088cc38..1b2b1b4d 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
Features section describes in detail about Resty capabilities
-
+
Resty Communication Channels