//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) }
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)) }
func GetQiniuPrivateDownloadUrl(domain, key string) string { baseUrl := rs.MakeBaseUrl(domain, key) policy := rs.GetPolicy{} return policy.MakeRequest(baseUrl, nil) }
func downloadUrl(domain, key string) string { baseUrl := rs.MakeBaseUrl(domain, key) policy := rs.GetPolicy{} return policy.MakeRequest(baseUrl, mac) }
func GetUrl(key string) string { baseUrl := rs.MakeBaseUrl(DOWNLOAD_URL, key) getPolicy := rs.GetPolicy{} return getPolicy.MakeRequest(baseUrl, nil) }