-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Http Client for accessing OpenSauced API client (#23)
- Integrates using the opensauced api client for doing "bake" operations - Integrates using the opensauced http client for doing "repo-query" operations Signed-off-by: John McBride <[email protected]>
- Loading branch information
Showing
7 changed files
with
105 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package api | ||
|
||
import "net/http" | ||
|
||
type Client struct { | ||
// The configured http client for making API requests | ||
HTTPClient *http.Client | ||
|
||
// The API endpoint to use when making requests | ||
// Example: https://api.opensauced.pizza or https://beta.api.opensauced.pizza | ||
Endpoint string | ||
} | ||
|
||
// NewClient creates a new OpenSauced API client for making http requests | ||
func NewClient(endpoint string) *Client { | ||
return &Client{ | ||
HTTPClient: &http.Client{}, | ||
Endpoint: endpoint, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package api | ||
|
||
const ( | ||
APIEndpoint = "https://api.opensauced.pizza/v1" | ||
BetaAPIEndpoint = "https://beta.api.opensauced.pizza/v1" | ||
) |