-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Azure file Support #2605
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 Azure file Support #2605
Conversation
… and directory operations
…ations and edge cases
…ations and edge cases
Umang01-hash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- In the provided example of
main.go:
// Configure Azure File Storage
accountName := app.Config.Get("AZURE_STORAGE_ACCOUNT_NAME")
accountKey := app.Config.Get("AZURE_STORAGE_ACCOUNT_KEY")
shareName := app.Config.Get("AZURE_FILE_SHARE_NAME")
endpoint := app.Config.Get("AZURE_STORAGE_ENDPOINT")
// Validate required configuration
if accountName == "" {
app.Logger().Error("AZURE_STORAGE_ACCOUNT_NAME is required")
return
}
if accountKey == "" {
app.Logger().Error("AZURE_STORAGE_ACCOUNT_KEY is required")
return
}
if shareName == "" {
app.Logger().Error("AZURE_FILE_SHARE_NAME is required")
return
}
azureConfig := &azure.Config{
AccountName: accountName,
AccountKey: accountKey,
ShareName: shareName,
Endpoint: endpoint,
}
// Create Azure File Storage filesystem
azureFS, err := azure.New(azureConfig, app.Logger(), app.Metrics())
if err != nil {
app.Logger().Errorf("Failed to initialize Azure File Storage: %v", err)
return
}This validation should be done internally in GoFr, and not by the user.
-
The coverage of file
fs.gois very low ~58% can we try and improve it?? -
In the file
fs_test.go, I commented the TestNew_WithEndpoint, TestNew_DefaultEndpoint and still got the same coverage. Please remove then also. -
No if-else conditions in test, please create separate methods if needed.
|
@Umang01-hash, Refactored the tests as suggested. A few functions still have required conditional branches within the struct—these determine whether additional fields need to be asserted for specific use cases. |
Pull Request Template
Description:
Example :
Checklist:
goimportandgolangci-lint.Thank you for your contribution!