Documentation ¶
Index ¶
- Constants
- Variables
- func CreateFile(c *gin.Context) (int, error)
- func CreateFiles(c *gin.Context) (int, error)
- func DeleteFile(c *gin.Context) (int, error)
- func RetrieveFile(c *gin.Context) (model.File, int, error)
- func RetrieveFiles(c *gin.Context) []model.File
- func UpdateFile(c *gin.Context) (model.File, int, error)
- func Upload(reader *multipart.Reader, kind int)
- func UploadAndSyncArticles(c *gin.Context) (int, error)
- func UploadImageFile(part *multipart.Part)
- func UploadImages(c *gin.Context) (int, error)
- type FileForm
- type FilesForm
- type UploadStatus
- type Uploader
Constants ¶
View Source
const ( KindUploaderBasic = 1 KindUploaderArticle = 2 )
Kinds of uploader.
Variables ¶
View Source
var ( BasicUploader = basicUploader() Cargador = basicUploader() Shàngchuán = basicUploader() Article업로더 = articleUploader() ArticleUploader = articleUploader() ArticleCargador = articleUploader() ArticleShàngchuán = articleUploader() Articleзагрузчик = articleUploader() )
Functions ¶
func RetrieveFile ¶
RetrieveFile retrieves a file.
func UpdateFile ¶
UpdateFile updates a file.
func UploadAndSyncArticles ¶
UploadAndSyncArticles uploads images and sync articles.
func UploadImageFile ¶
UploadImageFile uploads an image file to a storage.
Types ¶
type FileForm ¶
type FileForm struct { Id int64 `form:"id"` UserId int64 `form:"userId"` Name string `form:"name" binding:"required"` Size int `form:"size" binding:"required"` }
FileForm is used when creating or updating a file.
type FilesForm ¶
type FilesForm struct {
Files []FileForm `form:"json" binding:"required"`
}
FilesForm is used when creating or updating multiple files.
type UploadStatus ¶
type UploadStatus bool
func UploadAgent ¶
func UploadAgent(reader *multipart.Reader, replicas ...Uploader) UploadStatus
UploadAgent is loadbalancer of uploader.
type Uploader ¶
type Uploader func(reader *multipart.Reader) UploadStatus
Click to show internal directories.
Click to hide internal directories.