This commit is contained in:
Atridad Lahiji
2023-05-18 20:04:55 -06:00
committed by Atridad Lahiji
parent 84591f3a2d
commit 3d719132f1
96 changed files with 3422 additions and 4793 deletions

14
lib/s3.go Normal file
View File

@ -0,0 +1,14 @@
package lib
import (
"fmt"
"os"
)
func GeneratePublicURL(key string) string {
bucket := os.Getenv("BUCKET_NAME")
endpoint := os.Getenv("AWS_ENDPOINT_URL_S3")
url := fmt.Sprintf("%s/%s/%s", endpoint, bucket, key)
return url
}