feat: Azure backend implementation

This commit is contained in:
jonaustin09
2023-12-29 21:55:32 -08:00
committed by Ben McClelland
parent 3b945f72fc
commit 8cc89fa713
3 changed files with 341 additions and 18 deletions
+5 -9
View File
@@ -36,13 +36,13 @@ func azureCommand() *cli.Command {
Name: "account",
Usage: "azure account name",
EnvVars: []string{"AZ_ACCESS_KEY"},
Aliases: []string{"s"},
Aliases: []string{"a"},
Destination: &azAccount,
},
&cli.StringFlag{
Name: "secret",
Usage: "azure secret key",
EnvVars: []string{"AZ_SECRET_KEY"},
Name: "account-key",
Usage: "azure account key",
EnvVars: []string{"AZ_ACCOUNT_KEY"},
Aliases: []string{"s"},
Destination: &azKey,
},
@@ -58,10 +58,6 @@ func azureCommand() *cli.Command {
}
func runAzure(ctx *cli.Context) error {
if ctx.NArg() == 0 {
return fmt.Errorf("no directory provided for operation")
}
if azServiceURL == "" {
// if not otherwise specified, use the typical form: http(s)://<account>.blob.core.windows.net/
azServiceURL = fmt.Sprintf("https://%s.blob.core.windows.net/", azAccount)
@@ -69,7 +65,7 @@ func runAzure(ctx *cli.Context) error {
be, err := azure.New(azAccount, azKey, azServiceURL)
if err != nil {
return fmt.Errorf("init posix: %v", err)
return fmt.Errorf("init azure: %v", err)
}
return runGateway(ctx.Context, be)