-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4402 from nickmango/feature/post-gerrit
Feature/Gerrit Post response update
- Loading branch information
Showing
5 changed files
with
386 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package apiclient | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
) | ||
|
||
type APIClient interface { | ||
GetData(ctx context.Context, url string) (*http.Response, error) | ||
} | ||
|
||
type RestAPIClient struct { | ||
Client *http.Client | ||
} | ||
|
||
// GetData makes a get request to the specified url | ||
|
||
func (c *RestAPIClient) GetData(ctx context.Context, url string) (*http.Response, error) { | ||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return c.Client.Do(req) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.