Skip to content

Commit 101d68b

Browse files
committed
Remove unused code related to HTTP client methods and version
1 parent aa20327 commit 101d68b

File tree

6 files changed

+15
-33
lines changed

6 files changed

+15
-33
lines changed

httpclient/httpclient_request.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ import (
6565
func (c *Client) DoRequest(method, endpoint string, body, out interface{}) (*http.Response, error) {
6666
log := c.Logger
6767

68-
if IsIdempotentHTTPMethod(method) {
68+
if method.IsIdempotentHTTPMethod(method) {
6969
return c.executeRequestWithRetries(method, endpoint, body, out)
70-
} else if IsNonIdempotentHTTPMethod(method) {
70+
} else if method.IsNonIdempotentHTTPMethod(method) {
7171
return c.executeRequest(method, endpoint, body, out)
7272
} else {
7373
return nil, log.Error("HTTP method not supported", zap.String("method", method))

httpclient/httpclient_version.go

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// httpclient_methods.go
2-
package httpclient
1+
// method/httpmethod.go
2+
package method
33

44
/* Ref: https://www.rfc-editor.org/rfc/rfc7231#section-8.1.3
55
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// httpclient_methods_test.go
2-
package httpclient
1+
// method/httpmethod_test.go
2+
package method
33

44
import (
55
"net/http"

version/version.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
// version.go
22
package version
33

4-
// AppName holds the name of the application
5-
var AppName = "go-api-http-client"
4+
import "fmt"
65

7-
// Version holds the current version of the application
8-
var Version = "0.0.91"
6+
const (
7+
SDKVersion = "0.0.90"
8+
UserAgentBase = "go-api-http-client"
9+
)
910

10-
// GetAppName returns the name of the application
11-
func GetAppName() string {
12-
return AppName
13-
}
14-
15-
// GetVersion returns the current version of the application
16-
func GetVersion() string {
17-
return Version
11+
func GetUserAgentHeader() string {
12+
return fmt.Sprintf("%s/%s", UserAgentBase, SDKVersion)
1813
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// httpclient_version_test.go
2-
package httpclient
1+
// version_test.go
2+
package version
33

44
import (
55
"fmt"

0 commit comments

Comments
 (0)