This is the implementation of Put.io API in Golang.
The documentation for the OAuth2 HTTP API can be found here.
A basic usage of the SDK is provided below. All other calls follow similar pattern.
package main
import (
"os"
"fmt"
"log"
"github.com/activatedgeek/putio/api"
"github.com/activatedgeek/putio/api/commons"
)
func main() {
// create a new API session
session := api.NewSession(os.Getenv("PUTIO_ACCESS_TOKEN"), commons.NewEmptyConfig())
// list all the files in root folder
_, body, err := session.Files.List("0")
if err != nil {
log.Fatal(err)
}
fmt.Println(body)
}
-
Files
- List
- Search
- Upload
- Create Folder
- Get
- Delete
- Rename
- Move
- Convert to MP4
- Get MP4 Status
- Download
- Share
- Shared With
- Unshare
- Subtitles
- Default Subtitle
- Subtitle
- Default HLS Playlist
- HLS Playlist
- Set Video Position
- Delete Video Position
-
Events
- List
- Delete
-
Transfers
- List
- Add
- Get
- Retry
- Cancel
- Clean
-
Zip
- Create
- List
- Get
-
Friends
- List
- List Requests
- Request
- Approve
- Deny
- Unfriend
-
Account
- Info
- Settings
- Set Settings
NOTE: glide
is used for dependency management
Keep this package in your GOPATH
and run glide install
.