Add debug flag

This commit is contained in:
Ryan Cavicchioni 2021-03-29 17:23:20 -05:00
parent dbe1c40e16
commit 2107a05864
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

View File

@ -21,6 +21,7 @@ type (
accessToken string accessToken string
userAgent string userAgent string
Client *http.Client Client *http.Client
debug bool
} }
Result struct { Result struct {
@ -102,6 +103,12 @@ func WithUserAgent(userAgent string) func(*Client) {
} }
} }
func WithDebug(debug bool) func(*Client) {
return func(c *Client) {
c.debug = debug
}
}
func NewClientWithUserAgent(accessToken string, userAgent string) *Client { func NewClientWithUserAgent(accessToken string, userAgent string) *Client {
tr := &http.Transport{ tr := &http.Transport{
//TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper), //TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),