Documentation ¶
Index ¶
- type StorageService
- func (s *StorageService) DeleteFile(ctx context.Context, filePath string) error
- func (s *StorageService) GetFileMetadata(ctx context.Context, filePath string) (*storage.ObjectAttrs, error)
- func (s *StorageService) ListImages(ctx context.Context) ([]string, error)
- func (s *StorageService) UploadFile(ctx context.Context, filePath string, fileData io.Reader) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StorageService ¶
StorageService encapsulates the Google Cloud Storage client and related operations.
func NewStorageService ¶
func NewStorageService(ctx context.Context, bucketName, credentialsPath string) (*StorageService, error)
NewStorageService initializes a new storage service with the provided Google Cloud Storage bucket.
func (*StorageService) DeleteFile ¶
func (s *StorageService) DeleteFile(ctx context.Context, filePath string) error
DeleteFile deletes a file from cloud storage.
func (*StorageService) GetFileMetadata ¶
func (s *StorageService) GetFileMetadata(ctx context.Context, filePath string) (*storage.ObjectAttrs, error)
GetFileMetadata retrieves metadata of a file stored in cloud storage.
func (*StorageService) ListImages ¶
func (s *StorageService) ListImages(ctx context.Context) ([]string, error)
ListImages retrieves a list of image URLs from the cloud storage.
func (*StorageService) UploadFile ¶
func (s *StorageService) UploadFile(ctx context.Context, filePath string, fileData io.Reader) (string, error)
UploadFile uploads any file to the cloud storage and returns its URL.
Click to show internal directories.
Click to hide internal directories.