Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const DefaultExpires = 14
DefaultExpires is the default number of days until the file will be deleted by File.io.
Variables ¶
View Source
var URL = "https://file.io"
URL is by default the url of the File.io API.
Functions ¶
func Download ¶
Download downloads the file behind the key to the given file. An error occurs if the key does not exist or if the file fails to be create.
func Upload ¶
Upload uploads a file to file.io and returns its key or an error if it can not. A default expires of 14 days is internally used.
Example ¶
package main
import (
"fmt"
"github.com/rvflash/fileio"
)
func main() {
key, err := fileio.Upload("test.txt")
if err != nil {
panic(err)
}
if err := fileio.Download(key, "/tmp/test.txt"); err != nil {
panic(err)
}
fmt.Println("Yeah, good boy.")
}
Output: Yeah, good boy.
Types ¶
Click to show internal directories.
Click to hide internal directories.