Documentation ¶
Index ¶
- func Connect() (stow.Container, error)
- func ConnectFrontend() (stow.Container, error)
- func Container(location stow.Location, containerName string) (stow.Container, error)
- type ImageStorage
- func (s *ImageStorage) CreateNeedImage(t *model.Token, needID int64, fh *multipart.FileHeader) (*model.NeedImage, error)
- func (s *ImageStorage) CreateOrganizationImage(t *model.Token, fh *multipart.FileHeader) (*model.OrganizationImage, error)
- func (s *ImageStorage) DeleteNeedImage(t *model.Token, needID, imageID int64) error
- func (s *ImageStorage) DeleteOrganizationImage(t *model.Token, imageID int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectFrontend ¶
ConnectFrontend will connect to the frontends file container
Types ¶
type ImageStorage ¶
type ImageStorage struct { BasePublicURL string Container stow.Container NeedRepository needImageRepo OrganizationRepository orgImageRepo }
ImageStorage will save files into the storage and reference then into the database
func (*ImageStorage) CreateNeedImage ¶
func (s *ImageStorage) CreateNeedImage(t *model.Token, needID int64, fh *multipart.FileHeader) (*model.NeedImage, error)
CreateNeedImage storages and links the uploaded file with the Need
func (*ImageStorage) CreateOrganizationImage ¶
func (s *ImageStorage) CreateOrganizationImage(t *model.Token, fh *multipart.FileHeader) (*model.OrganizationImage, error)
CreateOrganizationImage storages and link the image with the organization
func (*ImageStorage) DeleteNeedImage ¶
func (s *ImageStorage) DeleteNeedImage(t *model.Token, needID, imageID int64) error
DeleteNeedImage removes the image from a need, if user has permission
func (*ImageStorage) DeleteOrganizationImage ¶
func (s *ImageStorage) DeleteOrganizationImage(t *model.Token, imageID int64) error
DeleteOrganizationImage removes the image from a need, if user has permission
Click to show internal directories.
Click to hide internal directories.