-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GCP, Firebase, Azure file uploading support #17
Labels
enhancement
New feature or request
Comments
picking this up @abhishekraj272 |
@uzaxirr @abhishekraj272 ? |
The Private Key and Acess ID would be stored in environment variables. The snippet below is an example. // Set the bucket and object names.
bucketName := "my-bucket"
objectName := "my-object"
// Set the signed URL expiration time to one hour from now.
expirationTime := time.Now().Add(time.Hour).Unix()
// Get the private key and access ID from environment variables.
privateKey := os.Getenv("PRIVATE_KEY")
accessID := os.Getenv("ACCESS_ID")
// Set the signed URL options.
opt := &storage.SignedURLOptions{
GoogleAccessID: accessID,
PrivateKey: []byte(privateKey),
Method: "GET",
Expires: expirationTime,
ContentType: "application/octet-stream",
}
// Create the signed URL.
signedURL, err := storage.SignedURL(bucketName, objectName, opt)
if err != nil {
// Handle error.
return
} |
@loyaltytrooper do let me know if you are ready to take this up, i'll assign this to you |
Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We need a function which takes an enum (Azure, GCP, AWS, Firebase) param and generates a preSignedURL to for its cloud storage
The text was updated successfully, but these errors were encountered: