pcloud

package module
v0.0.0-...-f4d0149 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 15 Imported by: 0

README

pcloud

pcloud client in golang

Install

go install github.com/igolaizola/pcloud/cmd/pcloud@latest

Usage

TBD, meanwhile use pcloud help to see the available commands.

TODO

  • Reduce memory usage removing not needed extra buffers.
  • Implement other API calls like delete, download, etc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPrivateKey

func LoadPrivateKey(privFile string) (*rsa.PrivateKey, error)

func SavePrivateKey

func SavePrivateKey(priv *rsa.PrivateKey, dst string) error

Types

type Client

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

func New

func New(endpoint string, opts ...Option) *Client

func (*Client) AuthToken

func (c *Client) AuthToken() string

func (*Client) List

func (c *Client) List(ctx context.Context, path string) ([]string, []string, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context, user, pass string) error

func (*Client) PrivateKey

func (c *Client) PrivateKey() *rsa.PrivateKey

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

func (*Client) UnlockCrypto

func (c *Client) UnlockCrypto(ctx context.Context, cryptoPass string) error

func (*Client) UploadFile

func (c *Client) UploadFile(ctx context.Context, src, dst string) error

type Metadata

type Metadata struct {
	Name     string
	IsFolder bool
	ID       int
}

type Option

type Option func(*Client)

func WithCredentials

func WithCredentials(user, pass string) Option

func WithCryptoPassword

func WithCryptoPassword(cryptoPass string) Option

func WithDebug

func WithDebug() Option

func WithPrivateKey

func WithPrivateKey(priv *rsa.PrivateKey) Option

func WithToken

func WithToken(auth string) Option

Directories

Path Synopsis
cmd
pkg
api
cli

Jump to

Keyboard shortcuts

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