cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPutioTokenRequired is an error for required put.io token
	ErrPutioTokenRequired = errors.New("please provide put.io token via flags or PUTIO_TOKEN env-var")

	// ErrPutioTokenInvalid is an error for invalid put.io token
	ErrPutioTokenInvalid = errors.New("invalid put.io token")

	// ErrMissingArgs is an error for missing arguments
	ErrMissingArgs = errors.New("you need to provide args")

	// FlagColorEnabled hold color output switcher
	FlagColorEnabled *bool

	// FlagVersion holds boolean for displaying version information
	FlagVersion *bool
	// FlagToken holds put.io token, default value is set from PUTIO_TOKEN env-var
	FlagToken *string

	// FlagSetList is a list subcommand
	FlagSetList *flag.FlagSet
	// FlagListShowDownloadURL is a boolean option to display list as download url
	FlagListShowDownloadURL *bool
	// FlagListShowOnlyID is a boolean option to display list as file id
	FlagListShowOnlyID *bool

	// FlagSetUpload is a download subcommand
	FlagSetUpload *flag.FlagSet

	// FlagSetMove is a move subcommand
	FlagSetMove *flag.FlagSet

	// FlagSetDelete is a delete subcommand
	FlagSetDelete *flag.FlagSet
)

Functions

This section is empty.

Types

type Application

type Application struct {
	In     io.Reader
	Out    io.Writer
	Client *putio.Client
}

Application represents application structure

func NewApplication

func NewApplication() *Application

NewApplication returns new Application instance

func (*Application) CommandDelete

func (a *Application) CommandDelete() error

CommandDelete deletes given file ids

func (*Application) CommandList

func (a *Application) CommandList() error

CommandList fetches given folder id

func (*Application) CommandMove

func (a *Application) CommandMove() error

CommandMove moves given file ids to target folder

func (*Application) CommandUpload

func (a *Application) CommandUpload() error

CommandUpload @wip - implement file upload soon!

func (*Application) Run

func (a *Application) Run() error

Run executes main application

func (*Application) Validate

func (a *Application) Validate() error

Validate validates required params

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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