Debian Codegraph @

/

debian golang-github-putdotio-go-putio 0.0~git20190822.19b9c63-3debian golang-github-putdotio-go-putio-dev debiangoinimakefilemarkdownshellyaml 31 files · 43 symbols
View dependency graph

Depends on

README (full)

putio Build Status

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

Documentation

Available on GoDoc

Install

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

Usage

package main

import (
        "fmt"
        "log"
        "context"

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

func main() {
    oauthToken := "<YOUR-TOKEN-HERE>"
    tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: oauthToken})
    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)
}
dir debian/
dir putio/
file .travis.yml
file LICENSE
file README.md