https://github.com/rvflash/fileio
Golang interface for uploading or downloading files with file.io.
https://github.com/rvflash/fileio
file-io golang
Last synced: 2 months ago
JSON representation
Golang interface for uploading or downloading files with file.io.
- Host: GitHub
- URL: https://github.com/rvflash/fileio
- Owner: rvflash
- License: mit
- Created: 2017-05-03T17:16:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-03T19:59:20.000Z (about 8 years ago)
- Last Synced: 2025-01-28T16:16:29.406Z (4 months ago)
- Topics: file-io, golang
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# File.io
[](https://godoc.org/github.com/rvflash/fileio)
[](https://travis-ci.org/rvflash/fileio)
[](http://codecov.io/github/rvflash/fileio?branch=master)
[](https://goreportcard.com/report/github.com/rvflash/fileio)Golang interface for uploading or downloading files with file.io.
### Installation
```bash
$ go get -u github.com/rvflash/fileio
```### Usage
The import of the package and check of errors are ignored for the demo.
#### Upload a file
```go
key, _ := fileio.Upload("/data/file.txt")
println(key)
// Output: 2ojE41
```#### Upload a file with an expiration date (here, 7 days)
```go
key, expiry, _ := fileio.UploadWithExpire("/data/file.txt", 7)
println(key + " expires in " + expiry)
// Output: aQbnDJ expires in 1 week
```#### Download a file
```go
err := fileio.Download("2ojE41", "/tmp/file.txt")
```