mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 23:50:48 +02:00
- 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.
43 lines
925 B
Go
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
|
|
}
|