Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 944 Bytes

README.md

File metadata and controls

55 lines (37 loc) · 944 Bytes

FileX

File management for Golang

Build Status Go Report Card

go get github.com/prongbang/filex

How to use

  • New FileX
fileX := filex.New()
  • Make Directory
isSuccess := fileX.Mkdir("public/thumbnail")
  • Create Image from Bytes Array
imgPath := "public/thumbnail/image.jpeg"

imgByte := []byte("mock image byte array")
fileX.CreateImage(imgByte, imgPath)
  • Create File from Multipart
path := "public/thumbnail"
filename := "image.jpeg"
var file *multipart.FileHeader = mockFile
pathFile, err := fileX.CreateMultipart(path, filename, file)
  • Delete file
path, err := fileX.Delete(imgPath)
  • Delete directory
err := fileX.DeleteDir("dir")