https://github.com/prongbang/filex
File management for Golang
https://github.com/prongbang/filex
create-file create-image create-image-from-text filex golang
Last synced: 12 months ago
JSON representation
File management for Golang
- Host: GitHub
- URL: https://github.com/prongbang/filex
- Owner: prongbang
- License: mit
- Created: 2020-06-28T12:16:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-01T03:53:15.000Z (over 2 years ago)
- Last Synced: 2025-06-14T22:43:55.654Z (12 months ago)
- Topics: create-file, create-image, create-image-from-text, filex, golang
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FileX
File management for Golang
[](https://travis-ci.org/prongbang/filex)
[](https://goreportcard.com/report/github.com/prongbang/filex)
```
go get github.com/prongbang/filex
```
### How to use
- New FileX
```go
fileX := filex.New()
```
- Make Directory
```go
isSuccess := fileX.Mkdir("public/thumbnail")
```
- Create Image from Bytes Array
```go
imgPath := "public/thumbnail/image.jpeg"
imgByte := []byte("mock image byte array")
fileX.CreateImage(imgByte, imgPath)
```
- Create File from Multipart
```go
path := "public/thumbnail"
filename := "image.jpeg"
var file *multipart.FileHeader = mockFile
pathFile, err := fileX.CreateMultipart(path, filename, file)
```
- Delete file
```go
path, err := fileX.Delete(imgPath)
```
- Delete directory
```go
err := fileX.DeleteDir("dir")
```