mirror of
https://github.com/versity/versitygw.git
synced 2026-09-19 06:32:10 +00:00
feat: Azure backend implementation
This commit is contained in:
committed by
Ben McClelland
parent
3b945f72fc
commit
8cc89fa713
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user