An experimental IndieWeb site built in Go.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 33290a94de2d47494661cd925883dea75b75a387 34 lines 643 B view raw
1package storage 2 3import ( 4 "context" 5 "log" 6 "os" 7 8 "github.com/aws/aws-sdk-go-v2/aws" 9 "github.com/aws/aws-sdk-go-v2/config" 10 "github.com/aws/aws-sdk-go-v2/service/s3" 11) 12 13var s3Client *s3.Client 14 15func S3() *s3.Client { 16 if s3Client != nil { 17 return s3Client 18 } 19 20 sdkConfig, err := config.LoadDefaultConfig(context.Background()) 21 if err != nil { 22 log.Printf("Couldn't load default configuration. Here's why: %v\n", err) 23 panic(err) 24 } 25 26 svc := s3.NewFromConfig(sdkConfig, func(o *s3.Options) { 27 o.BaseEndpoint = aws.String("https://" + os.Getenv("AWS_S3_ENDPOINT")) 28 o.Region = os.Getenv("AWS_REGION") 29 }) 30 31 s3Client = svc 32 33 return svc 34}