uploader

package module
v0.0.0-...-a7ae2ba Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: MIT Imports: 14 Imported by: 0

README

使用goroutine的多图片上传包

实现的功能

  • 多图片上传
  • 限制图片大小
  • 限制图片数量
  • 限制上传图片类型
  • 按日期切割图片
  • 使用协程并发操作图片
  • 超时机制

运行

go get -v github.com/lujiahaoo/gin-upload

配置

假设项目目录结构如下(缩略了一些)

project/
├── config
│   ├── app.yml
│   └── refreshtoken.txt
├── go.mod
├── go.sum
├── main.go
├── static
│   ├── 2020-04-12
│   │   ├── 7wyabtlgzs.jpg
│   │   ├── n514brfa9d.jpg
│   │   └── xlfs4ldl5z.jpg
│   └── thumbnail
│       └── 7wyabtlgzs.jpg

其中存放图片的static目录可以按自己需要更改

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRandomString

func GenRandomString(length int) []byte

func UploadImage

func UploadImage(ctx *gin.Context) ([]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