commands

package
v0.0.0-...-6272bae Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CommitHash describing current build
	CommitHash string
	// BuildTime marking time when built
	BuildTime string

	// BaseURL to pCloud API
	BaseURL = "https://api.pcloud.com"
	// ClientID is pCloud ID of pcloud-cli
	ClientID = "wMJTDKXtja"
	// ClientSecret is secret key needed to identify app
	ClientSecret = "bCS3k9W89t0zL51qpcL2Ck3bjnF7"

	// AccessToken for user
	AccessToken string
)
View Source
var (
	// FileCmd declares the sub-command group file
	FileCmd = &cobra.Command{
		Use:   "file",
		Short: "Actions to manage files.",
		Long: `All commands related to mangage files.
This includes rename file, upload file, download file, etc.`,

		Run: func(cmd *cobra.Command, args []string) {

		},
	}
)
View Source
var (
	// FolderCmd declares the sub-command group folder
	FolderCmd = &cobra.Command{
		Use:   "folder",
		Short: "Actions to manage folders.",
		Long: `All commands related to mangage folders.
This includes rename folder, create folder, delete folder, etc.`,

		Run: func(cmd *cobra.Command, args []string) {

		},
	}
)
View Source
var RootCmd = &cobra.Command{
	Use:   "pCloud-cli",
	Short: "pCloud-cli is a command line interface to the pCloud API.",
	Long: `A command line interface to interact with pCloud storage.
More info can be found on github, http://github.com/storvik/pcloud-cli`,
	Run: func(cmd *cobra.Command, args []string) {

	},
}

RootCmd declares the main command

Functions

func Execute

func Execute(commithash, buildtime, baseurl, clientid, clientsecret string)

Execute adds all child commands to the root command

Types

type Pcloud

type Pcloud struct {
	Endpoint    string
	Parameters  url.Values
	AccessToken string
	Body        io.Reader
	Headers     map[string]string
}

Pcloud struct containing requests

func NewPcloud

func NewPcloud() *Pcloud

NewPcloud return new Pcloud struct, defined above

func (*Pcloud) Query

func (p *Pcloud) Query() ([]byte, error)

Query API endpoint with url parameters. If authorization is true, the authorization header is set. Returns json []byte and optional error from server.

Jump to

Keyboard shortcuts

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