Skip to content

Commit

Permalink
Merge pull request nedpals#6 from Fritte795/change-allow-client-trans…
Browse files Browse the repository at this point in the history
…portconfig

Allow Postgrest Client Transport Configuration
  • Loading branch information
nedpals authored Oct 28, 2023
2 parents f37e112 + c6bada7 commit fff4d85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package postgrest_go

import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
Expand All @@ -21,7 +23,7 @@ type ClientOption func(c *Client)
func NewClient(baseURL url.URL, opts ...ClientOption) *Client {
transport := PostgrestTransport{
baseURL: baseURL,
parent: http.DefaultTransport,
Parent: http.DefaultTransport,
}

c := Client{
Expand Down
4 changes: 2 additions & 2 deletions pkg/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type PostgrestTransport struct {
baseURL url.URL
debug bool

parent http.RoundTripper
Parent http.RoundTripper
}

func (c *PostgrestTransport) RoundTrip(req *http.Request) (*http.Response, error) {
Expand All @@ -25,5 +25,5 @@ func (c *PostgrestTransport) RoundTrip(req *http.Request) (*http.Response, error
fmt.Println("---------------------------------")
}

return c.parent.RoundTrip(req)
return c.Parent.RoundTrip(req)
}

0 comments on commit fff4d85

Please sign in to comment.