Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/abuarque/simple-compression-service/src/libs/storage

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/abuarque/simple-compression-service/src/libs/storage

  • v0.0.0-20200503195939-19940a9f5bc6
  • Source
  • Go
  • Socket score

Version published
Created
Source

Storage package

To use it import to your project:

$ go get github.com/ABuarque/simple-compression-service/src/libs/storage

It provides an API to upload files to a pCloud account. To use it, call method NewPCloudClient with your credentials to get a pointer to PCloudClient:

// NewPCloudClient creates a new pCloud client
func NewPCloudClient(username, password string) (*PCloudClient, error) {
	c := &http.Client{}
	token, err := authenticate(c, username, password)
	if err != nil {
		return nil, err
	}
	return &PCloudClient{Client: c, Token: token}, nil
}

And to push a file to pCloud account call method Put:

// Put sends a file to pcloud
func (p *PCloudClient) Put(filename string, r io.Reader) (string, error) {
	fileID, err := uploadFile(p, filename, r)
	if err != nil {
		return "", err
	}
	URL, err := generatePublicLink(p, fileID)
	if err != nil {
		return "", err
	}
	return URL, nil
}

Observations

Implementation taken from dadosjus/remuneraçōes project.

FAQs

Package last updated on 03 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc