Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions github/repos_contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,23 @@ func (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path
return deleteResponse, resp, nil
}

// archiveFormat is used to define the archive type when calling GetArchiveLink.
type archiveFormat string
// ArchiveFormat is used to define the archive type when calling GetArchiveLink.
type ArchiveFormat string

const (
// Tarball specifies an archive in gzipped tar format.
Tarball archiveFormat = "tarball"
Tarball ArchiveFormat = "tarball"

// Zipball specifies an archive in zip format.
Zipball archiveFormat = "zipball"
Zipball ArchiveFormat = "zipball"
)

// GetArchiveLink returns an URL to download a tarball or zipball archive for a
// repository. The archiveFormat can be specified by either the github.Tarball
// or github.Zipball constant.
//
// GitHub API docs: https://developer.github.com/v3/repos/contents/#get-archive-link
func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat archiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) {
func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, followRedirects bool) (*url.URL, *Response, error) {
u := fmt.Sprintf("repos/%s/%s/%s", owner, repo, archiveformat)
if opts != nil && opts.Ref != "" {
u += fmt.Sprintf("/%s", opts.Ref)
Expand Down