Documentation
¶
Index ¶
- Variables
- type Bucket
- type ImageFile
- type ImageFileSize
- type MockNotifierService
- func (m *MockNotifierService) CreateNotification(ctx context.Context, notification domain.Notification) error
- func (m *MockNotifierService) GetNotifications(ctx context.Context, profileID int, onlyUnread bool) ([]*domain.Notification, error)
- func (m *MockNotifierService) MarkNotificationRead(ctx context.Context, notificationID int, profileID *int) error
- func (m *MockNotifierService) MarkNotificationUnread(ctx context.Context, notificationID int, profileID *int) error
- func (m *MockNotifierService) SSESubscribe(ctx context.Context, topic string, handler ssepubsub.MessageHandler) error
- func (m *MockNotifierService) SSEUnsubscribe(ctx context.Context, topic string) error
- type MockStorageClient
- func (msc *MockStorageClient) CreateBucket(bucketName string, location string) error
- func (msc *MockStorageClient) DeleteFile(bucket Bucket, objectName string) error
- func (msc *MockStorageClient) GetImageObjectFromFile(file *ImageFile) (*domain.Photo, error)
- func (msc *MockStorageClient) GetImageObjectsFromFiles(files []*ImageFile) ([]domain.Photo, error)
- func (msc *MockStorageClient) GetPresignedURL(bucket Bucket, objectName string, expiry time.Duration) (string, error)
- func (msc *MockStorageClient) UploadFile(bucket Bucket, objectName string, fileStream io.Reader) (*int, error)
- type NoImagesInFiles
- type StorageClient
- func (sc *StorageClient) CreateBucket(bucketName string, location string) error
- func (sc *StorageClient) DeleteFile(bucket Bucket, objectName string) error
- func (sc *StorageClient) GetImageObjectFromFile(image *ImageFile) (*domain.Photo, error)
- func (sc *StorageClient) GetImageObjectsFromFiles(files []*ImageFile) ([]domain.Photo, error)
- func (sc *StorageClient) GetPresignedURL(bucket Bucket, objectName string, expiry time.Duration) (string, error)
- func (sc *StorageClient) UploadFile(bucket Bucket, objectName string, fileStream io.Reader) (*int, error)
- type StorageClientInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBucketDoesNotExist = errors.New("requested bucket does not exist")
Functions ¶
This section is empty.
Types ¶
type ImageFile ¶
type ImageFile struct {
ID int
Sizes []ImageFileSize
}
type ImageFileSize ¶
type MockNotifierService ¶
MockNotifierService is a mock of NotifierService interface
func NewMockNotifierService ¶
func NewMockNotifierService() *MockNotifierService
func (*MockNotifierService) CreateNotification ¶
func (m *MockNotifierService) CreateNotification(ctx context.Context, notification domain.Notification) error
func (*MockNotifierService) GetNotifications ¶
func (m *MockNotifierService) GetNotifications(ctx context.Context, profileID int, onlyUnread bool) ([]*domain.Notification, error)
func (*MockNotifierService) MarkNotificationRead ¶
func (*MockNotifierService) MarkNotificationUnread ¶
func (*MockNotifierService) SSESubscribe ¶
func (m *MockNotifierService) SSESubscribe(ctx context.Context, topic string, handler ssepubsub.MessageHandler) error
func (*MockNotifierService) SSEUnsubscribe ¶
func (m *MockNotifierService) SSEUnsubscribe(ctx context.Context, topic string) error
type MockStorageClient ¶
MockStorageClient is a mock implementation of the StorageClientInterface.
func NewMockStorageClient ¶
func NewMockStorageClient() *MockStorageClient
NewMockStorageClient creates a new instance of MockStorageClient.
func (*MockStorageClient) CreateBucket ¶
func (msc *MockStorageClient) CreateBucket(bucketName string, location string) error
func (*MockStorageClient) DeleteFile ¶
func (msc *MockStorageClient) DeleteFile(bucket Bucket, objectName string) error
func (*MockStorageClient) GetImageObjectFromFile ¶
func (msc *MockStorageClient) GetImageObjectFromFile(file *ImageFile) (*domain.Photo, error)
func (*MockStorageClient) GetImageObjectsFromFiles ¶
func (msc *MockStorageClient) GetImageObjectsFromFiles(files []*ImageFile) ([]domain.Photo, error)
func (*MockStorageClient) GetPresignedURL ¶
func (*MockStorageClient) UploadFile ¶
type NoImagesInFiles ¶
type NoImagesInFiles struct {
Message string
}
func (*NoImagesInFiles) Error ¶
func (e *NoImagesInFiles) Error() string
Error implements the error interface
type StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
func NewStorageClient ¶
func (*StorageClient) CreateBucket ¶
func (sc *StorageClient) CreateBucket(bucketName string, location string) error
func (*StorageClient) DeleteFile ¶
func (sc *StorageClient) DeleteFile(bucket Bucket, objectName string) error
func (*StorageClient) GetImageObjectFromFile ¶
func (sc *StorageClient) GetImageObjectFromFile(image *ImageFile) (*domain.Photo, error)
TODO: GetImageObjectFromFile and GetImageObjectsFromFiles can be standardized to return a specific file object. Expiration can also be parametrized if necessary. getPhotoObjectFromFile generates a signed URL for a single file.
func (*StorageClient) GetImageObjectsFromFiles ¶
func (sc *StorageClient) GetImageObjectsFromFiles( files []*ImageFile, ) ([]domain.Photo, error)
func (*StorageClient) GetPresignedURL ¶
func (*StorageClient) UploadFile ¶
type StorageClientInterface ¶
type StorageClientInterface interface {
CreateBucket(bucketName string, location string) error
UploadFile(bucket Bucket, objectName string, fileStream io.Reader) (*int, error)
DeleteFile(bucket Bucket, objectName string) error
GetPresignedURL(bucket Bucket, objectName string, expiry time.Duration) (string, error)
GetImageObjectFromFile(file *ImageFile) (*domain.Photo, error)
GetImageObjectsFromFiles(files []*ImageFile) ([]domain.Photo, error)
}
StorageClientInterface defines the interface for the storage client.
Click to show internal directories.
Click to hide internal directories.