-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
primitive support for externally hosted releases
- Loading branch information
1 parent
dccba08
commit 14d590e
Showing
3 changed files
with
49 additions
and
15 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
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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
package client | ||
|
||
import "strings" | ||
|
||
type DownloadableRelease struct { | ||
Url string `json:"url"` | ||
Release Release `json:"release"` | ||
Resource Resource `json:"resource"` | ||
} | ||
|
||
func DownloadableReleaseFromSuggestion(suggestion UrlSuggestion, release Release, resource Resource) DownloadableRelease { | ||
return DownloadableRelease{suggestion.Url,Release{release.Id,release.Service,release.ReleaseId,release.Version,release.Creation,suggestion.FileName,extensionFromFileName(suggestion.FileName),0,nil,nil,nil,nil,nil,nil,nil,true},resource} | ||
} | ||
|
||
func extensionFromFileName(fileName string) interface{} { | ||
parts := strings.Split(fileName,".") | ||
if len(parts) > 1 { | ||
return "." + parts[len(parts)-1] | ||
} | ||
return nil | ||
} |
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