storage

package
v0.0.0-...-4a4af7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StorageService

type StorageService struct {
	Client     *storage.Client
	BucketName string
}

StorageService encapsulates the Google Cloud Storage client and related operations.

func NewStorageService

func NewStorageService(ctx context.Context, bucketName string) (*StorageService, error)

NewStorageService initializes a new storage service with the provided Google Cloud Storage bucket.

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) UploadImage

func (s *StorageService) UploadImage(ctx context.Context, fileName string, imageData io.Reader) (string, error)

UploadImage uploads an image to the cloud storage and returns its URL.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL