Documentation ¶
Index ¶
Constants ¶
View Source
const ( AudioHeader = "audio/" MP3Header = AudioHeader + "mpeg" // audio/mpeg MP4Header = AudioHeader + "mp4" // audio/mp4 WAVHeader = AudioHeader + "wav" // audio/wav OGGHeader = AudioHeader + "ogg" // audio/ogg FLACHeader = AudioHeader + "flac" // audio/flac )
Constants for the content-type headers for audio files
Variables ¶
This section is empty.
Functions ¶
func GetContentType ¶
GetContentType returns the content-type header for a given audio file extension
Types ¶
type DownloadError ¶
type DownloadError struct {
Err error
}
func (*DownloadError) Error ¶
func (de *DownloadError) Error() string
type DownloadUploader ¶
type DownloadUploader interface { Uploader Downloader }
type Downloader ¶
type Downloader interface {
DownloadObject(ctx context.Context, objectName, bucket string) ([]byte, error)
}
Downloader defines the API for downloading objects to S3 storage
type MinioClient ¶
type MinioClient struct {
// S3Client is the service client for MinIO
S3Client *minio.Client
}
MinioClient is a struct that implements the DownloadUploader interface using MinIO's S3 SDK for Go
func NewMinioClient ¶
func NewMinioClient(client *minio.Client) *MinioClient
func (*MinioClient) DownloadObject ¶
func (m *MinioClient) DownloadObject(ctx context.Context, objectName, bucket string) ([]byte, error)
DownloadObject downloads an object from a MinIO bucket with the given object name TODO this needs to return the file/data received
func (*MinioClient) UploadObject ¶
func (uploader *MinioClient) UploadObject(ctx context.Context, filename, bucket string) error
UploadObject uploads to an MinIO bucket with the given file
type S3Client ¶
S3Client is a struct that implements the DownloadUploader interface using AWS's S3 SDK for Go
func (*S3Client) DownloadObject ¶
DownloadObject downloads from the given file an AWS bucket
type UploadError ¶
type UploadError struct {
Err error
}
func (*UploadError) Error ¶
func (ue *UploadError) Error() string
Click to show internal directories.
Click to hide internal directories.