Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
NewService creates a new fileutils Service instance that can be used to upload, download, and delete files from S3.
func (*Service) DeleteFile ¶
DeleteFile deletes a file from S3.
func (*Service) DeleteFiles ¶
/ DeleteFiles deletes multiple files from S3.
func (*Service) DownloadFile ¶
DownloadFile downloads a file.
handler code:
// Set headers for the response w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s", fileName)) w.Header().Set("Content-Type", "application/octet-stream") w.Header().Set("Content-Length", fmt.Sprintf("%d", len(buf.Bytes()))) // Write the file to the response _, err = w.Write(buf.Bytes()) if err != nil { http.Error(w, "Failed to write file to response", http.StatusInternalServerError) return }
Click to show internal directories.
Click to hide internal directories.