NLT2KLKIAZ62ALZUXKN744RK7TGGIY56ROUTFB4IJW6FXIEKWAIQC
M4QYSJ524RKUZVECNRBH5S2R5KM5XO4CVU4LOWNT2DNLGRK323RAC
objectKey: "",
objectKey: "IMG_0487.PNG",
func DownloadData(ctx context.Context, env Env, data []byte) error {
func DownloadFromBucket(ctx context.Context, env Env, data []byte) ([]byte, error) {
return returnValue
return nil, returnValue
return fmt.Errorf("could not download from bucket: %v", err)
return nil, fmt.Errorf("could not download from bucket: %v", err)
return fmt.Errorf("couldn't read all download data: %v", err)
return nil, fmt.Errorf("couldn't read all download data: %v", err)
return fmt.Errorf("different object obtained: %q != %q", data, receivedContents)
return nil, fmt.Errorf("different object obtained: %q != %q", data, receivedContents)
return nil
return receivedContents, nil
func RunStorjCaller() error {
func GetBucketData() ([]byte, error) {
err := DownloadData(context.Background(), env, nil)
data, err := DownloadFromBucket(context.Background(), env, nil)
return fmt.Errorf("error downloading data: %v", err)
return nil, fmt.Errorf("error downloading data: %v", err)
// fmt.Println("Yes! We did it!") return nil
// fmt.Println("Yes! We did it!")
return data, nil
"fmt"
c.JSON(http.StatusOK, gin.H{ "message": "hitting storj", })
c.JSON(http.StatusOK, gin.H{
"message": "hitting storj",
})
_, err := GetBucketData() if err != nil { fmt.Printf("Error: %v", err) return }
_, err := GetBucketData()
if err != nil {
fmt.Printf("Error: %v", err)
return
}