예제 #1
0
func buildEntitlementJson(flags *EntitlementFlags, create bool) string {
	m := map[string]string{
		"access":        flags.Access,
		"download_keys": cliutils.BuildListString(flags.Keys),
		"path":          flags.Path,
	}
	return cliutils.MapToJson(m)
}
예제 #2
0
func builJson(flags *UrlSigningFlags) string {
	m := map[string]string{
		"expiry":          flags.Expiry,
		"valid_for_secs":  flags.ValidFor,
		"callback_id":     flags.CallbackId,
		"callback_email":  flags.CallbackEmail,
		"callback_url":    flags.CallbackUrl,
		"callback_method": flags.CallbackMethod,
	}
	return cliutils.MapToJson(m)
}
예제 #3
0
func CreateVersionJson(versionName string, flags *VersionFlags) string {
	m := map[string]string{
		"name": versionName,
		"desc": flags.Desc,
		"github_release_notes_file":    flags.GithubReleaseNotesFile,
		"VcsTag":                       flags.VcsTag,
		"released":                     flags.Released,
		"github_use_tag_release_notes": flags.GithubUseTagReleaseNotes,
	}
	return cliutils.MapToJson(m)
}
예제 #4
0
func doCreateVersion(versionDetails *utils.VersionDetails, flags *utils.VersionFlags, bintrayDetails *config.BintrayDetails) (*http.Response, []byte, error) {
	if bintrayDetails.User == "" {
		bintrayDetails.User = versionDetails.Subject
	}
	var data string
	if flags != nil {
		data = utils.CreateVersionJson(versionDetails.Version, flags)
	} else {
		m := map[string]string{
			"name": versionDetails.Version}
		data = cliutils.MapToJson(m)
	}

	url := bintrayDetails.ApiUrl + "packages/" + versionDetails.Subject + "/" +
		versionDetails.Repo + "/" + versionDetails.Package + "/versions"
	httpClientsDetails := utils.GetBintrayHttpClientDetails(bintrayDetails)
	return ioutils.SendPost(url, []byte(data), httpClientsDetails)
}
예제 #5
0
func CreatePackageJson(packageName string, flags *PackageFlags) string {
	m := map[string]string{
		"name":                      packageName,
		"desc":                      flags.Desc,
		"labels":                    cliutils.BuildListString(flags.Labels),
		"licenses":                  cliutils.BuildListString(flags.Licenses),
		"custom_licenses":           cliutils.BuildListString(flags.CustomLicenses),
		"vcs_url":                   flags.VcsUrl,
		"website_url":               flags.WebsiteUrl,
		"issue_tracker_url":         flags.IssueTrackerUrl,
		"github_repo":               flags.GithubRepo,
		"github_release_notes_file": flags.GithubReleaseNotesFile,
		"public_download_numbers":   flags.PublicDownloadNumbers,
		"public_stats":              flags.PublicStats,
	}

	return cliutils.MapToJson(m)
}