client

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config map[string]string

Config holds our client config

Functions

func DecryptFiles

func DecryptFiles(p string, key string) (string, error)

DecryptFiles decrypts then unzips a file using a private key and returns the path of the resulting file/folder on success zip step should be optional TODO

func DownloadData

func DownloadData(url string, filePath string) error

DownloadData retrieves a file from the server and saves contents at filePath

func EncryptFiles

func EncryptFiles(args []string, recipient string, keyPath string) (string, error)

EncryptFiles zips then encrypts our arguments (files or folders) using a public key

func LoadConfig

func LoadConfig() error

LoadConfig reads or creates our config file at ~/.sendto/config

func LoadKey

func LoadKey(recipient string, url string) (string, error)

LoadKey loads the key associated with this username, first by loooking at ~/.sendto/users/recipient/key.pub or if that fails by fetching it from the internet and saving at that location it returns the path of the downloaded key file

func ParsePublicKey

func ParsePublicKey(keyPath string) (*openpgp.Entity, error)

ParsePublicKey parses the given public key file

func PostData

func PostData(sender, recipient, file, url string) error

PostData sends data to the server

func SaveConfig

func SaveConfig() error

SaveConfig saves our config out to a file at ~/.sendto/config

Types

This section is empty.

Jump to

Keyboard shortcuts

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