https://github.com/mohan3d/gopenload
Golang client of the openload.co service.
https://github.com/mohan3d/gopenload
Last synced: 5 months ago
JSON representation
Golang client of the openload.co service.
- Host: GitHub
- URL: https://github.com/mohan3d/gopenload
- Owner: mohan3d
- License: mit
- Created: 2019-06-15T10:48:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-25T02:11:40.000Z (almost 7 years ago)
- Last Synced: 2023-08-27T13:08:20.629Z (almost 3 years ago)
- Language: Go
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gopenload
Golang client of the [openload.co](https://openload.co/) service.
[](https://travis-ci.org/mohan3d/gopenload)
[](https://goreportcard.com/report/github.com/mohan3d/gopenload)
[](https://godoc.org/github.com/mohan3d/gopenload/openload)
# Installation
```bash
$ go get github.com/mohan3d/gopenload
```
# Usage
implemented [API](https://openload.co/api) features.
**Retrieve account info**
```golang
package main
import (
"fmt"
"github.com/mohan3d/gopenload/openload"
)
func main() {
// Create a client.
client := openload.New("", "", nil)
// Get account info.
info, err := client.AccountInfo()
if err != nil {
panic(err)
}
fmt.Println(info.Email)
fmt.Println(info.SignupAt)
}
```
**Upload file**
```golang
package main
import (
"fmt"
"github.com/mohan3d/gopenload/openload"
)
func main() {
client := openload.New("", "", 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**
```golang
package main
import (
"fmt"
"github.com/mohan3d/gopenload/openload"
)
func main() {
client := openload.New("", "", nil)
info, err := client.FileInfo("uxbligkQAiN")
if err != nil {
panic(err)
}
fmt.Println(info.Name)
fmt.Println(info.Size)
fmt.Println(info.Status)
}
```