upload

package
v0.0.0-...-f863724 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PictureDir - save pictures file
	PictureDir = "picture"

	// VideoDir - save videos file
	VideoDir = "video"

	// OtherDir - files other than video and picture
	OtherDir = "other"

	//FileUploadDir - the root directory of the upload files
	FileUploadDir = "./pkg/upload/files"

	// FileKey - key of the file
	FileKey = "file"
)

Variables

This section is empty.

Functions

func CheckDir

func CheckDir(path ...string) error

CheckDir Verify directory existence, if directory dosen't exists then create it Stat returns a FileInfo describing the named file. IsNotExist if file or directory not exists return true MkdirAll creates a directory named path

func ClassifyBySuffix

func ClassifyBySuffix(suffix string) string

ClassifyBySuffix - return "pictrue", "vedio", "other"

func CopyFile

func CopyFile(path string, file []byte) error

CopyFile create a new file by path

func FilePath

func FilePath() map[string]string

FilePath - default fileDir

func MD5

func MD5(file []byte) (string, error)

MD5 return a hash value

Types

This section is empty.

Jump to

Keyboard shortcuts

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