Skip to content

Commit

Permalink
refactor: remove GetContents API
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Mar 1, 2024
1 parent 037d631 commit 7405af5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion pkg/download/github_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ type GitHubContentFileDownloader struct {
}

type GitHubContentAPI interface {
GetContents(ctx context.Context, repoOwner, repoName, path string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error)
}

Expand Down
1 change: 0 additions & 1 deletion pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type RepositoriesService interface {
GetArchiveLink(ctx context.Context, owner, repo string, archiveformat github.ArchiveFormat, opts *github.RepositoryContentGetOptions, maxRedirects int) (*url.URL, *github.Response, error)
GetReleaseByTag(ctx context.Context, owner, repoName, version string) (*github.RepositoryRelease, *github.Response, error)
DownloadReleaseAsset(ctx context.Context, owner, repoName string, assetID int64, httpClient *http.Client) (io.ReadCloser, string, error)
GetContents(ctx context.Context, repoOwner, repoName, path string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error)
}

Expand Down
7 changes: 0 additions & 7 deletions pkg/github/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ func (m *MockRepositoriesService) GetLatestRelease(ctx context.Context, repoOwne
return m.Releases[0], nil, nil
}

func (m *MockRepositoriesService) GetContents(ctx context.Context, repoOwner, repoName, path string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) {
if m.Content == nil {
return m.Content, nil, nil, errContentNotFound
}
return m.Content, nil, nil, nil
}

func (m *MockRepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) {
if m.Content == nil {
return nil, nil, errContentNotFound
Expand Down

0 comments on commit 7405af5

Please sign in to comment.