Beispiel #1
0
//download
func downloadUrl(domain, key string) string {
	baseUrl := rs.MakeBaseUrl(domain, key)
	//baseUrl = baseUrl + "?pm3u8/0/e/1438162783"
	baseUrl = baseUrl + "?avinfo"
	policy := rs.GetPolicy{}
	return policy.MakeRequest(baseUrl, nil)
}
Beispiel #2
0
func handleReturn(w http.ResponseWriter, req *http.Request) {

	ret := req.FormValue("upload_ret")
	b, err := base64.URLEncoding.DecodeString(ret)
	if err != nil {
		w.WriteHeader(404)
		return
	}

	var uploadRet UploadRet
	err = json.Unmarshal(b, &uploadRet)
	if err != nil {
		w.WriteHeader(404)
		return
	}

	policy := rs.GetPolicy{Scope: "*/" + uploadRet.Key}
	img := policy.MakeRequest(rs.MakeBaseUrl(DOMAIN, uploadRet.Key))
	returnPage := fmt.Sprintf(returnPageFmt, string(b), img, img)
	w.Write([]byte(returnPage))
}
Beispiel #3
0
func GetQiniuPrivateDownloadUrl(domain, key string) string {
	baseUrl := rs.MakeBaseUrl(domain, key)
	policy := rs.GetPolicy{}
	return policy.MakeRequest(baseUrl, nil)
}
Beispiel #4
0
func downloadUrl(domain, key string) string {
	baseUrl := rs.MakeBaseUrl(domain, key)
	policy := rs.GetPolicy{}
	return policy.MakeRequest(baseUrl, mac)
}
Beispiel #5
0
func GetUrl(key string) string {
	baseUrl := rs.MakeBaseUrl(DOWNLOAD_URL, key)
	getPolicy := rs.GetPolicy{}
	return getPolicy.MakeRequest(baseUrl, nil)
}