You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/putdotio/go-putio

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/putdotio/go-putio

v1.7.2
Source
Go
Version published
Created
Source

Golang CI Linter Golang Tests

putio

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

Documentation

Available on GoDoc

Install

go get github.com/putdotio/go-putio@latest
go get golang.org/x/oauth2@latest

Usage

package main

import (
        "fmt"
        "log"
        "context"

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

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

    client := putio.NewClient(oauthClient)

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

FAQs

Package last updated on 07 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts