Golang client of the openload.co service.
$ go get github.com/mohan3d/gopenload
implemented API features.
Retrieve account info
package main
import (
"fmt"
"github.com/mohan3d/gopenload/openload"
)
func main() {
// Create a client.
client := openload.New("<LOGIN>", "<KEY>", nil)
// Get account info.
info, err := client.AccountInfo()
if err != nil {
panic(err)
}
fmt.Println(info.Email)
fmt.Println(info.SignupAt)
}
Upload file
package main
import (
"fmt"
"github.com/mohan3d/gopenload/openload"
)
func main() {
client := openload.New("<LOGIN>", "<KEY>", nil)
uploaded, err := client.Upload("/path/dummyfile.txt", "", "", false)
if err != nil {
panic(err)
}
fmt.Println(uploaded.URL)
fmt.Println(uploaded.ID)
fmt.Println(uploaded.Size)
}
Retrieve file info
package main
import (
"fmt"
"github.com/mohan3d/gopenload/openload"
)
func main() {
client := openload.New("<LOGIN>", "<KEY>", nil)
info, err := client.FileInfo("uxbligkQAiN")
if err != nil {
panic(err)
}
fmt.Println(info.Name)
fmt.Println(info.Size)
fmt.Println(info.Status)
}