putiosync

package module
v2.0.39 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 34 Imported by: 0

README

putio-sync

Command-line program to sync a folder between put.io and your computer.

WARNING: The project is still in development and features are subject to change!

If you are using MacOS or Windows, you can install desktop version: putio-sync-desktop.

Build Status GitHub Release

Installing

If you are on MacOS you can install from brew:

brew install putdotio/putio-sync/putio-sync

Otherwise, get the latest binary from releases page.

Usage

Run the program with your account credentials:

putio-sync -username <username> -password <password>

Then program is going to sync the contents of these folders:

  • $HOME/putio-sync in your computer
  • /putio-sync in your Put.io account

The folders are created if they don't exist. The program exists after sync. You can run it again whenever you want to sync.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCredentials = errors.New("invalid credentials")

Functions

func Sync

func Sync(ctx context.Context, config Config) error

Types

type Config

type Config struct {
	// Username of put.io account.
	Username string
	// Password of put.io account.
	// An OAuth token can be used instead of password.
	// Token must be prefixed with "token/" (without quotes).
	// In that case, Username is not required.
	Password string
	// Do not make changes on filesystems. Only calculate what needs to be done.
	DryRun bool
	// Stop after first sync operation.
	// Otherwise, sync operation is repeated continuously while waiting for some duration between syncs.
	// If there is authentication error, Sync also returns since there is no point in retrying in this case.
	Once bool
	// Listen address for HTTP server.
	// The server has an endpoint for getting the status of the sync operation.
	Server string
	// Set log level to debug.
	Debug bool
}

func (*Config) Read added in v2.0.37

func (c *Config) Read(configPath string) error

type ConfigError added in v2.0.24

type ConfigError struct {
	Reason string
}

func (*ConfigError) Error added in v2.0.24

func (e *ConfigError) Error() string

Directories

Path Synopsis
cmd
putio-sync command
internal

Jump to

Keyboard shortcuts

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