Documentation
¶
Index ¶
- type APIError
- type APIErrorResponse
- type APIHandler
- func (h *APIHandler) HandleBucketCreate(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleBuckets(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleFolderCreate(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleHealth(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleObjectsDelete(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleObjectsDownload(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleObjectsList(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleObjectsUpload(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleProfiles(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleSettings(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleShutdown(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HandleStatus(w http.ResponseWriter, r *http.Request)
- type APIResponse
- type CreateBucketRequest
- type CreateFolderRequest
- type DeleteObjectsRequest
- type DownloadObjectRequest
- type ListObjectsRequest
- type ProfileProvider
- type S3ServiceCreator
- type UploadFileInfo
- type UploadObjectsRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
Code string `json:"code"`
Message string `json:"message"`
Details any `json:"details,omitempty"`
Suggestion string `json:"suggestion,omitempty"`
Category string `json:"category,omitempty"`
Severity string `json:"severity,omitempty"`
Retryable bool `json:"retryable,omitempty"`
}
APIError represents detailed error information
type APIErrorResponse ¶
type APIErrorResponse struct {
Success bool `json:"success"`
Error APIError `json:"error"`
RequestID string `json:"requestId,omitempty"`
}
APIErrorResponse represents a structured error response
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
APIHandler handles API requests with dependency injection
func NewAPIHandler ¶
func NewAPIHandler(profileProvider ProfileProvider, s3ServiceCreator S3ServiceCreator, logger *slog.Logger) *APIHandler
NewAPIHandler creates a new API handler with dependencies
func NewAPIHandlerWithShutdown ¶
func NewAPIHandlerWithShutdown(profileProvider ProfileProvider, s3ServiceCreator S3ServiceCreator, shutdownCh chan<- struct{}, logger *slog.Logger) *APIHandler
NewAPIHandlerWithShutdown creates a new API handler with shutdown channel
func (*APIHandler) HandleBucketCreate ¶
func (h *APIHandler) HandleBucketCreate(w http.ResponseWriter, r *http.Request)
HandleBucketCreate handles POST /api/buckets/create
func (*APIHandler) HandleBuckets ¶
func (h *APIHandler) HandleBuckets(w http.ResponseWriter, r *http.Request)
HandleBuckets handles GET /api/buckets
func (*APIHandler) HandleFolderCreate ¶
func (h *APIHandler) HandleFolderCreate(w http.ResponseWriter, r *http.Request)
HandleFolderCreate handles POST /api/objects/folder/create
func (*APIHandler) HandleHealth ¶
func (h *APIHandler) HandleHealth(w http.ResponseWriter, r *http.Request)
HandleHealth handles POST /api/health
func (*APIHandler) HandleObjectsDelete ¶
func (h *APIHandler) HandleObjectsDelete(w http.ResponseWriter, r *http.Request)
HandleObjectsDelete handles POST /api/objects/delete
func (*APIHandler) HandleObjectsDownload ¶
func (h *APIHandler) HandleObjectsDownload(w http.ResponseWriter, r *http.Request)
HandleObjectsDownload handles POST /api/objects/download
func (*APIHandler) HandleObjectsList ¶
func (h *APIHandler) HandleObjectsList(w http.ResponseWriter, r *http.Request)
HandleObjectsList handles POST /api/objects/list
func (*APIHandler) HandleObjectsUpload ¶
func (h *APIHandler) HandleObjectsUpload(w http.ResponseWriter, r *http.Request)
HandleObjectsUpload handles POST /api/objects/upload
func (*APIHandler) HandleProfiles ¶
func (h *APIHandler) HandleProfiles(w http.ResponseWriter, r *http.Request)
HandleProfiles handles GET /api/profiles
func (*APIHandler) HandleSettings ¶
func (h *APIHandler) HandleSettings(w http.ResponseWriter, r *http.Request)
HandleSettings handles POST /api/settings
func (*APIHandler) HandleShutdown ¶
func (h *APIHandler) HandleShutdown(w http.ResponseWriter, r *http.Request)
HandleShutdown handles POST /api/shutdown
func (*APIHandler) HandleStatus ¶
func (h *APIHandler) HandleStatus(w http.ResponseWriter, r *http.Request)
HandleStatus handles POST /api/status
type APIResponse ¶
type APIResponse struct {
Success bool `json:"success"`
Data any `json:"data,omitempty"`
Error string `json:"error,omitempty"`
RequestID string `json:"requestId,omitempty"`
}
APIResponse represents a standard API response
type CreateBucketRequest ¶
type CreateBucketRequest struct {
Name string `json:"name"`
}
CreateBucketRequest represents the request for creating a bucket
type CreateFolderRequest ¶
CreateFolderRequest represents the request for creating a folder
type DeleteObjectsRequest ¶
DeleteObjectsRequest represents the request payload for deleting objects
type DownloadObjectRequest ¶
type DownloadObjectRequest struct {
Bucket string `json:"bucket"`
Type string `json:"type"` // "files" or "folder"
Keys []string `json:"keys,omitempty"` // for files (single or multiple)
Prefix string `json:"prefix,omitempty"` // for folder
}
DownloadObjectRequest represents the request for downloading objects
type ListObjectsRequest ¶
type ListObjectsRequest struct {
Bucket string `json:"bucket"`
Prefix string `json:"prefix,omitempty"`
Delimiter string `json:"delimiter,omitempty"`
MaxKeys int32 `json:"maxKeys,omitempty"`
ContinuationToken string `json:"continuationToken,omitempty"`
}
ListObjectsRequest represents the request for listing objects
type ProfileProvider ¶
ProfileProvider interface for dependency injection
type S3ServiceCreator ¶
S3ServiceCreator is a function type for creating S3 services
type UploadFileInfo ¶
type UploadFileInfo struct {
Key string `json:"key"` // S3 object key
File string `json:"file"` // multipart form field name
}
UploadFileInfo represents information for a single file upload
type UploadObjectsRequest ¶
type UploadObjectsRequest struct {
Bucket string `json:"bucket"`
Uploads []UploadFileInfo `json:"uploads"`
}
UploadObjectsRequest represents the request for uploading multiple objects