api

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the official Put.io client

func NewClient

func NewClient(oauthToken string) *Client

NewClient creates a new Put.io API client

func (*Client) AddTransfer

func (c *Client) AddTransfer(magnetLink string, folderID int64) error

AddTransfer adds a new transfer (torrent) to Put.io

func (*Client) Authenticate

func (c *Client) Authenticate() error

Authenticate verifies the OAuth token by fetching account info

func (*Client) DeleteFile

func (c *Client) DeleteFile(fileID int64) error

DeleteFile removes a file from Put.io

func (*Client) DeleteTransfer

func (c *Client) DeleteTransfer(transferID int64) error

DeleteTransfer removes a transfer from Put.io

func (*Client) EnsureFolder

func (c *Client) EnsureFolder(name string) (int64, error)

EnsureFolder creates a folder if it doesn't exist or returns the ID if it does

func (*Client) GetAccountInfo

func (c *Client) GetAccountInfo() (*putio.AccountInfo, error)

GetAccountInfo returns the Put.io account information

func (*Client) GetAllTransferFiles added in v0.9.2

func (c *Client) GetAllTransferFiles(fileID int64) ([]*putio.File, error)

GetAllTransferFiles recursively gets all files in a transfer

func (*Client) GetDownloadURL

func (c *Client) GetDownloadURL(fileID int64) (string, error)

GetDownloadURL gets the download URL for a file

func (*Client) GetFiles

func (c *Client) GetFiles(folderID int64) ([]*putio.File, error)

GetFiles gets the contents of a folder

func (*Client) GetTransfers

func (c *Client) GetTransfers() ([]*putio.Transfer, error)

GetTransfers returns the list of current transfers

func (*Client) RetryTransfer added in v0.9.6

func (c *Client) RetryTransfer(transferID int64) (*putio.Transfer, error)

RetryTransfer retries a failed transfer

func (*Client) UploadFile added in v0.9.4

func (c *Client) UploadFile(data []byte, filename string, folderID int64) error

UploadFile uploads a torrent file to Put.io

Jump to

Keyboard shortcuts

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