rewrite getCredentials to be more generic
This commit is contained in:
@@ -14,9 +14,9 @@ const (
|
||||
BUCKETNAME = "ducimon-db-backups"
|
||||
)
|
||||
|
||||
func UploadFile(ctx context.Context, accessKeyID, secretAccessKey) error {
|
||||
func UploadFile(ctx context.Context, b2Creds map[string]string) error {
|
||||
|
||||
client := createClient(accessKeyID, secretAccessKey)
|
||||
client := createClient(b2Creds["B2_KEY_ID"], b2Creds["B2_APPLICATION_KEY"])
|
||||
verifyBucket(client, ctx)
|
||||
absolutePath, basename := validateUploadFile()
|
||||
_, err := client.FPutObject(ctx, BUCKETNAME, "test", absolutePath, minio.PutObjectOptions{})
|
||||
|
||||
Reference in New Issue
Block a user