package
0.0.0-20241018170054-3cebc5426995
Repository: https://github.com/phil-inc/pcommon.git
Documentation: pkg.go.dev

# README

AWS S3 Implementation

It uses the AWS SDK V2 for Go to create the S3 connection. It implements the basic functionality of S3 such as upload, download, listing, etc.

Prerequisites

  • AWS Secret Key
  • AWS Access Key
  • AWS Region

Uses

To start working with this dependency, you need to retrieve the dependency in your Go project with the following command.

go get github.com/phil-inc/pcommon

Example Code:

package main

import (
	"github.com/phil-inc/pcommon/pkg/s3"
)

func main() {
    client := s3.GetS3Client(assessKey, secretKey, region)
   	ctx := context.Background()

    buckets, err := client.ListBuckets(ctx)
    if err != nil {
        panic(err)
    }
    for _, bucket := range buckets.Buckets {
        fmt.Println(*bucket.Name + ": " + bucket.CreationDate.Format("2006-01-02 15:04:05 Monday"))
    }
}

# Functions

No description provided by the author
Checks if bucket naming rule is followed.
Parses an s3 URI for easy access to its different components.

# Structs

No description provided by the author
No description provided by the author
Struct for storing the bucket and key for an item on s3.
No description provided by the author