Choose your storage product

Polycloud

Object Storage

10 GB FREE

Device Backup

WD My Cloud Home

 

Choose your storage product

Polycloud

Object Storage

10 GB FREE

Device Backup

WD My Cloud Home

 

AWS SDK for Go

Installation:

go get -u github.com/aws/aws-sdk-go

Create a `main.go` file with the following contents (substituting `mybucket` with your information):

package main

import (
	"fmt"
	"log"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
)

func main() {
	sess, err := session.NewSession(&aws.Config{
		Region:   aws.String("us-east-1"),
		Endpoint: aws.String("https://polycloud.crowdapis.com"),
	},
	)

	svc := s3.New(sess)
	resp, err := svc.ListObjectsV2(&s3.ListObjectsV2Input{Bucket: aws.String("mybucket")})
	if err != nil {
		log.Fatal(err)
	}

	for _, item := range resp.Contents {
		fmt.Println(*item.Key)
	}
}

Run the example

AWS_ACCESS_KEY_ID=<your access key> AWS_SECRET_ACCESS_KEY=<your secret> go run main