storage

package
v0.0.0-...-7fa7ca5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MIMEOctetStream = "application/octet-stream"

Variables

View Source
var (
	ErrMissingFile     = errors.NewErrors(fiber.StatusBadRequest, "You must enter file.")
	ErrUnvalidMIMEType = errors.NewErrors(fiber.StatusForbidden, "You must enter valid file. Please check extension!")
	ErrMaxUploadSize   = errors.NewErrors(fiber.StatusForbidden, "You've reached max file size!")
)
View Source
var MIMEExtensions = map[string]string{}/* 105 elements not displayed */

MIME types were copied from https://github.com/nginx/nginx/blob/master/conf/mime.types

Functions

func GetMIME

func GetMIME(extension string) (mime string)

GetMIME returns the content-type of a file extension

func IsValidMIME

func IsValidMIME(extension string) bool

func UpdateAvatar

func UpdateAvatar(c *fiber.Ctx, uu *ent.UserUpdateOne, name string, removeAvatar bool) error

func UploadFile

func UploadFile(c *fiber.Ctx, opts FileOpts) error

Types

type FileOpts

type FileOpts struct {
	FormName string
	SavePath string
	Width    int
	Height   int
	Required bool
	DoFunc   func()
}

Jump to

Keyboard shortcuts

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