aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/repos_pages.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/repos_pages.go')
-rw-r--r--vendor/github.com/google/go-github/github/repos_pages.go25
1 files changed, 14 insertions, 11 deletions
diff --git a/vendor/github.com/google/go-github/github/repos_pages.go b/vendor/github.com/google/go-github/github/repos_pages.go
index e4bb6d8..3d19b43 100644
--- a/vendor/github.com/google/go-github/github/repos_pages.go
+++ b/vendor/github.com/google/go-github/github/repos_pages.go
@@ -5,7 +5,10 @@
package github
-import "fmt"
+import (
+ "context"
+ "fmt"
+)
// Pages represents a GitHub Pages site configuration.
type Pages struct {
@@ -36,7 +39,7 @@ type PagesBuild struct {
// GetPagesInfo fetches information about a GitHub Pages site.
//
// GitHub API docs: https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site
-func (s *RepositoriesService) GetPagesInfo(owner, repo string) (*Pages, *Response, error) {
+func (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pages", owner, repo)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -47,7 +50,7 @@ func (s *RepositoriesService) GetPagesInfo(owner, repo string) (*Pages, *Respons
req.Header.Set("Accept", mediaTypePagesPreview)
site := new(Pages)
- resp, err := s.client.Do(req, site)
+ resp, err := s.client.Do(ctx, req, site)
if err != nil {
return nil, resp, err
}
@@ -58,7 +61,7 @@ func (s *RepositoriesService) GetPagesInfo(owner, repo string) (*Pages, *Respons
// ListPagesBuilds lists the builds for a GitHub Pages site.
//
// GitHub API docs: https://developer.github.com/v3/repos/pages/#list-pages-builds
-func (s *RepositoriesService) ListPagesBuilds(owner, repo string) ([]*PagesBuild, *Response, error) {
+func (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string) ([]*PagesBuild, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -66,7 +69,7 @@ func (s *RepositoriesService) ListPagesBuilds(owner, repo string) ([]*PagesBuild
}
var pages []*PagesBuild
- resp, err := s.client.Do(req, &pages)
+ resp, err := s.client.Do(ctx, req, &pages)
if err != nil {
return nil, resp, err
}
@@ -77,7 +80,7 @@ func (s *RepositoriesService) ListPagesBuilds(owner, repo string) ([]*PagesBuild
// GetLatestPagesBuild fetches the latest build information for a GitHub pages site.
//
// GitHub API docs: https://developer.github.com/v3/repos/pages/#list-latest-pages-build
-func (s *RepositoriesService) GetLatestPagesBuild(owner, repo string) (*PagesBuild, *Response, error) {
+func (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pages/builds/latest", owner, repo)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -85,7 +88,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(owner, repo string) (*PagesBui
}
build := new(PagesBuild)
- resp, err := s.client.Do(req, build)
+ resp, err := s.client.Do(ctx, req, build)
if err != nil {
return nil, resp, err
}
@@ -96,7 +99,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(owner, repo string) (*PagesBui
// GetPageBuild fetches the specific build information for a GitHub pages site.
//
// GitHub API docs: https://developer.github.com/v3/repos/pages/#list-a-specific-pages-build
-func (s *RepositoriesService) GetPageBuild(owner, repo string, id int) (*PagesBuild, *Response, error) {
+func (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int) (*PagesBuild, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pages/builds/%v", owner, repo, id)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
@@ -104,7 +107,7 @@ func (s *RepositoriesService) GetPageBuild(owner, repo string, id int) (*PagesBu
}
build := new(PagesBuild)
- resp, err := s.client.Do(req, build)
+ resp, err := s.client.Do(ctx, req, build)
if err != nil {
return nil, resp, err
}
@@ -115,7 +118,7 @@ func (s *RepositoriesService) GetPageBuild(owner, repo string, id int) (*PagesBu
// RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit.
//
// GitHub API docs: https://developer.github.com/v3/repos/pages/#request-a-page-build
-func (s *RepositoriesService) RequestPageBuild(owner, repo string) (*PagesBuild, *Response, error) {
+func (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pages/builds", owner, repo)
req, err := s.client.NewRequest("POST", u, nil)
if err != nil {
@@ -126,7 +129,7 @@ func (s *RepositoriesService) RequestPageBuild(owner, repo string) (*PagesBuild,
req.Header.Set("Accept", mediaTypePagesPreview)
build := new(PagesBuild)
- resp, err := s.client.Do(req, build)
+ resp, err := s.client.Do(ctx, req, build)
if err != nil {
return nil, resp, err
}