Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 23 days 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-01T03:53:15.000Z (9 months ago)
- Last Synced: 2024-10-10T19:11:07.210Z (about 1 month 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
[![Build Status](http://img.shields.io/travis/prongbang/filex.svg)](https://travis-ci.org/prongbang/filex)
[![Go Report Card](https://goreportcard.com/badge/github.com/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")
```