Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateContentType(contentType string) error
- func ValidateFileSize(size int) error
- type Client
- func (c *Client) DeleteObject(ctx context.Context, key string) error
- func (c *Client) GeneratePresignedGetURL(ctx context.Context, key string) (string, error)
- func (c *Client) GeneratePresignedPutURL(ctx context.Context, key, contentType string) (string, error)
- func (c *Client) HealthCheck(ctx context.Context) error
- func (c *Client) ObjectExists(ctx context.Context, key string) (bool, error)
Constants ¶
View Source
const ( MaxFileSize = 5 * 1024 * 1024 // 5 MB PresignedExpiry = 15 * time.Minute DownloadExpiry = 1 * time.Hour )
Variables ¶
Functions ¶
func ValidateContentType ¶
ValidateContentType checks if the content type is allowed
func ValidateFileSize ¶
ValidateFileSize checks if the file size is within limits
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps S3-compatible storage operations
func NewClient ¶
func NewClient(cfg *appconfig.StorageConfig) (*Client, error)
NewClient creates a new storage client using AWS SDK v2
func (*Client) DeleteObject ¶
DeleteObject deletes an object from storage
func (*Client) GeneratePresignedGetURL ¶
GeneratePresignedGetURL generates a presigned URL for downloading
func (*Client) GeneratePresignedPutURL ¶
func (c *Client) GeneratePresignedPutURL(ctx context.Context, key, contentType string) (string, error)
GeneratePresignedPutURL generates a presigned URL for uploading
func (*Client) HealthCheck ¶
HealthCheck performs a health check on the storage
Click to show internal directories.
Click to hide internal directories.