Skip to content

vidu171/dell-ecs-s3-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dell-ecs-s3-client

Golang client for Dell EMC s3 storage

The dell-ecs-s3-client is a modified module for Delll ECS s3 storage. This package has been created by making some modifications on the aws-sdk-go package. To meet the requirements of dell ECS s3 storage.

Installing

To use the package just run the following command

go get github.com/vidu171/dell-ecs-s3-client

Usage

func WriteS3ObjectToFile(bucket, fileName string) {

	// Create S3 Session
	sess := GetS3Session(
		"<ENDPOINT>",
		"<ACCESS_ID>",
		"<SECRET_KEY>",
		"",
	)
	file, err := os.Create(fileName)
	if err != nil {
		log.Fatalf("Unable to open file %q, %v", fileName, err)
	}

	defer file.Close()

	downloader := s3manager.NewDownloader(sess)
	numBytes, err := downloader.Download(file,
		&s3.GetObjectInput{
			Bucket: aws.String(bucket),
			Key:    aws.String(fileName),
		})
	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("Downloaded", file.Name(), numBytes, "bytes")
}

About

Golang client for Dell EMC s3 storage

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages