Documentation
¶
Index ¶
- type Service
- func (s *Service) BulkDeleteFiles(ctx context.Context, uploadedKeys []string)
- func (s *Service) BulkUploadFiles(ctx context.Context, payloads []*s3.PutObjectInput) ([]string, error)
- func (s *Service) DeleteFile(ctx context.Context, s3Path, filename, s3Key *string) error
- func (s *Service) FileExists(ctx context.Context, s3Path, filename string) (bool, error)
- func (s *Service) GeneratePreSignedDownloadURL(ctx context.Context, s3Path, filename string, expirationSeconds int64) (string, error)
- func (s *Service) GenerateUploadPayload(ctx context.Context, data []byte, s3Path, filename string, ...) (*s3.PutObjectInput, error)
- func (s *Service) UploadFile(ctx context.Context, data []byte, s3Path, filename string, ...) error
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
}
Service provides methods for interacting with AWS S3
func NewS3Service ¶
NewS3Service creates a new S3 service instance
func (*Service) BulkDeleteFiles ¶
BulkDeleteFiles deletes multiple files from S3
func (*Service) BulkUploadFiles ¶
func (s *Service) BulkUploadFiles(ctx context.Context, payloads []*s3.PutObjectInput) ([]string, error)
BulkUploadFiles uploads multiple files given a list of payloads. Auto rollback if there are errors
func (*Service) DeleteFile ¶
DeleteFile deletes a file from S3
func (*Service) FileExists ¶
FileExists checks if a file exists in S3
func (*Service) GeneratePreSignedDownloadURL ¶
func (s *Service) GeneratePreSignedDownloadURL(ctx context.Context, s3Path, filename string, expirationSeconds int64) (string, error)
GeneratePreSignedDownloadURL generates a pre-signed URL for downloading a file from S3 The URL will be valid for the specified duration (in seconds)
func (*Service) GenerateUploadPayload ¶
func (s *Service) GenerateUploadPayload(ctx context.Context, data []byte, s3Path, filename string, metadata map[string]string) (*s3.PutObjectInput, error)
GenerateUploadPayload generates a payload for uploading a file to S3 have the same signature as UploadFile, but return the payload instead of uploading for bulk upload