storage

package
v0.0.0-...-a35bd06 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() (stow.Container, error)

Connect to storage and return the container

func ConnectFrontend

func ConnectFrontend() (stow.Container, error)

ConnectFrontend will connect to the frontends file container

func Container

func Container(location stow.Location, containerName string) (stow.Container, error)

Container search or create directory/bucket to store files

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

Jump to

Keyboard shortcuts

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