Files
GoMFT/internal/db/storage_provider_connector.go
StarFleetCPTN 31871bd16e feat: Implement storage provider management functionality
- Added new routes and handlers for managing storage providers, including creation, editing, and deletion.
- Introduced a new StorageProvider form component for user input.
- Enhanced the database schema to support storage provider references in transfer configurations.
- Implemented encryption for sensitive fields in storage provider data.
- Added tests for storage provider API endpoints and integration with the database.
- Updated frontend components to support storage provider selection and testing.
2025-04-16 17:18:53 -07:00

43 lines
925 B
Go

package db
import (
"time"
)
// ConnectorError represents different types of connection errors
type ConnectorError struct {
Code string
Message string
Err error
}
// ConnectionResult contains the result of a connection test
type ConnectionResult struct {
Success bool
Message string
Error *ConnectorError
Timestamp time.Time
}
// Common error codes
const (
ErrorCodeUnknown = "unknown"
ErrorCodeTimeout = "timeout"
ErrorCodeAuthentication = "authentication"
ErrorCodeConnection = "connection"
ErrorCodeResourceNotFound = "resource_not_found"
ErrorCodeInvalidParams = "invalid_params"
ErrorCodePermission = "permission"
ErrorCodeNetwork = "network"
)
// Error returns the error message
func (e *ConnectorError) Error() string {
return e.Message
}
// Unwrap returns the underlying error
func (e *ConnectorError) Unwrap() error {
return e.Err
}