From 88853b4d83ec313aa748c10791f243f59f67c6af Mon Sep 17 00:00:00 2001 From: Michael Tiller Date: Tue, 28 Apr 2015 11:47:49 -0400 Subject: [PATCH] Add DownloadURL field to RepositoryContent struct The RepositoryContent struct doesn't quite map to the API because it is missing a download link. This link is very useful because while the API doesn't allow large files to be downloaded, the link allows the raw files to be downloaded outside the API. --- github/repos_contents.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/github/repos_contents.go b/github/repos_contents.go index cd6d371..0d0e4d9 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -19,16 +19,17 @@ import ( // RepositoryContent represents a file or directory in a github repository. type RepositoryContent struct { - Type *string `json:"type,omitempty"` - Encoding *string `json:"encoding,omitempty"` - Size *int `json:"size,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - Content *string `json:"content,omitempty"` - SHA *string `json:"sha,omitempty"` - URL *string `json:"url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` + Type *string `json:"type,omitempty"` + Encoding *string `json:"encoding,omitempty"` + Size *int `json:"size,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Content *string `json:"content,omitempty"` + SHA *string `json:"sha,omitempty"` + URL *string `json:"url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + DownloadURL *string `json:"download_url,omitempty"` } // RepositoryContentResponse holds the parsed response from CreateFile, UpdateFile, and DeleteFile.