storeuploads

package
v1.6.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2018 License: GPL-3.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DirProjects     = "projects"
	DirProjectImage = "projectimage"
	DirUploads      = "uploads"

	FileProjectProfile = "image"

	PathPlaceholderImage = "static/img/placeholder.svg"
)

Variables

This section is empty.

Functions

func GetProjectImagePath

func GetProjectImagePath(pathInDataBase string) string

GetProjectImagePath will check if the stored image is present in the data directory. If the image can not be found the path of the placeholder will be returned.

func WriteProjectImageToFile

func WriteProjectImageToFile(imageSource string, project project.Project) (string, error)

WriteProjectImageToFile will write the project image to file. The imageSource can either be a base64 encoded string or a relative path to an image. Only if the image is a base64 encoded string (which means the user uploaded a new image) then it will be written in the data/<project name> directory for the project. If the image is a path, the project.Image property will be returned

func WriteUploadToFile

func WriteUploadToFile(filename string, fileSource string, project project.Project) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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