Documentation ¶
Index ¶
- Constants
- Variables
- func GetImagePath(pathInDataBase string, imageType string) string
- func WriteProfilePictureToFile(imageSource string, user user.User) (string, error)
- func WriteProjectImageToFile(imageSource string, project project.Project) (string, error)
- func WriteUploadToFile(filename string, fileSource string, project project.Project) (string, error)
Constants ¶
const ( DirProjects = "projects" DirProjectImage = "projectimage" DirUsers = "users" DirUserImage = "userimage" DirUploads = "uploads" FileProjectProfile = "image" FileProfilePicture = "image" PathGenericPlaceholderImage = "/static/img/placeholder.svg" PathProfilePlaceholderImage = "/static/img/profile-placeholder.png" )
Variables ¶
var ImageType = newImageTypeRegistry()
"Enum" for Image Types
Functions ¶
func GetImagePath ¶
GetImagePath 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 WriteProfilePictureToFile ¶
WriteProfilePictureToFile will write the profile 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/<username> directory for the project. If the image is a path, the user.Image property will be returned
func WriteProjectImageToFile ¶
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
Types ¶
This section is empty.