Documentation ¶
Index ¶
- func CodeAndMessageForUploadError(err error) (int, string)
- func RetrieveUploadedImage(r *http.Request, key string) (io.ReadCloser, error)
- func StoreImage(file io.ReadCloser, options UploadOptions) (string, string, error)
- func ToLocalImagePath(url string, config *services.Config) string
- func ToLocalThumbnailPath(url string, config *services.Config) string
- type ByteSize
- type UploadOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CodeAndMessageForUploadError ¶
CodeAndMessageForUploadError returns a code and an error message for the given error
func RetrieveUploadedImage ¶
RetrieveUploadedImage returns the uploaded file at the given key
func StoreImage ¶
func StoreImage(file io.ReadCloser, options UploadOptions) (string, string, error)
StoreImage stores in disk a file received with the request
Types ¶
type UploadOptions ¶
type UploadOptions struct {
StorePath, ThumbnailStorePath, WebStorePath, WebThumbnailStorePath string
MaxHeight, MaxWidth, ThumbnailHeight, ThumbnailWidth int
}
func DefaultUploadOptions ¶
func DefaultUploadOptions(config *services.Config) UploadOptions
DefaultUploadOptions returns the default configuration options for uploading
func ProfileUploadOptions ¶
func ProfileUploadOptions(config *services.Config) UploadOptions
ProfileUploadOptions returns the default configuration options for uploading profile pictures
Click to show internal directories.
Click to hide internal directories.