func generateQiniuUpToken(scope, accessKey, secretKey string, sizeLimit int64) string { mac := qauth.Mac{AccessKey: accessKey, SecretKey: []byte(secretKey)} policy := qrs.PutPolicy{} policy.Scope = scope policy.ReturnBody = `{"key": $(key), "mimeType": $(mimeType), "fsize": $(fsize)}` policy.FsizeLimit = sizeLimit return policy.Token(&mac) }