go-putio

module
v0.0.0-...-9440673 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2017 License: MIT

README

putio Build Status

putio is a Go client library for accessing the Put.io v2 API.

documentation

the documentation is available on godoc.

install

go get -u github.com/igungor/go-putio/putio"

usage

package main

import (
        "fmt"
        "log"
        "context"

        "golang.org/x/oauth2"
        "github.com/igungor/go-putio/putio"
)

func main() {
    tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: "<YOUR-TOKEN-HERE>"})
    oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource)

    client := putio.NewClient(oauthClient)

    const rootDir = 0
    root, err := client.Files.Get(context.Background(), rootDir)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(root.Filename)
}

Directories

Path Synopsis
Package putio is the Put.io API v2 client for Go.
Package putio is the Put.io API v2 client for Go.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL