Skip to content

Commit

Permalink
Merge pull request #20 from NickJorens/main
Browse files Browse the repository at this point in the history
Change baseUrl to BaseUrl
  • Loading branch information
Vardominator authored Oct 10, 2023
2 parents 603c2be + 9ed8619 commit a4adea2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/block_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type BlockInfo struct {
}

func (c *Client) BlockInfo(blockHeight int64) (*BlockInfo, error) {
req, err := http.NewRequest("GET", fmt.Sprintf("%s/blocks/%d", c.baseUrl, blockHeight), nil)
req, err := http.NewRequest("GET", fmt.Sprintf("%s/blocks/%d", c.BaseUrl, blockHeight), nil)
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Client struct {
network string
version string
HTTPClient *http.Client
baseUrl string
BaseUrl string
}

func NewClient(apiKey string, network string) *Client {
Expand All @@ -29,7 +29,7 @@ func NewClient(apiKey string, network string) *Client {
HTTPClient: &http.Client{
Timeout: 5 * time.Minute,
},
baseUrl: fmt.Sprintf("https://%s.gomaestro-api.org/%s", network, cfg.Client.Version),
BaseUrl: fmt.Sprintf("https://%s.gomaestro-api.org/%s", network, cfg.Client.Version),
}
}

Expand Down Expand Up @@ -78,7 +78,7 @@ func (c *Client) sendRequest(req *http.Request, responseBody *string) error {
}

func (c *Client) get(url string) (*http.Response, error) {
req, err := http.NewRequest("GET", c.baseUrl+url, nil)
req, err := http.NewRequest("GET", c.BaseUrl+url, nil)
req.Header.Set("Accept", "application/json")
req.Header.Add("api-key", c.apiKey)
if err != nil {
Expand All @@ -92,7 +92,7 @@ func (c *Client) post(url string, body interface{}) (*http.Response, error) {
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", c.baseUrl+url, bytes.NewReader(jsonBody))
req, err := http.NewRequest("POST", c.BaseUrl+url, bytes.NewReader(jsonBody))
req.Header.Set("Accept", "application/json")
req.Header.Add("api-key", c.apiKey)
if err != nil {
Expand Down

0 comments on commit a4adea2

Please sign in to comment.