Debian Codegraph @

/

debian golang-github-dtylman-scp 0.0~git20181017.f3000a3-3debian golang-github-dtylman-scp-dev debiangoinimakefilemarkdownshell 15 files · 48 symbols
View dependency graph

Depends on

README (full)

scp

Go Report Card

A Simple go SCP client library.

Usage

import (
  "github.com/dtylman/scp"
  "golang.org/x/crypto/ssh"
)

Sending Files

Copies /var/log/messages to remote /tmp/lala:

var sc* ssh.Client
// establish ssh connection into sc here...
n,err:=scp.CopyTo(sc, "/var/log/messages", "/tmp/lala")
if err==nil{
  fmt.Printf("Sent %v bytes",n)
}

Receiving Files

Copies remote /var/log/message to local /tmp/lala:

var sc* ssh.Client
// establish ssh connection into sc here...
n,err:=scp.CopyFrom(sc, "/var/log/message", "/tmp/lala")
if err==nil{
  fmt.Printf("Sent %v bytes",n)
}
dir debian/
dir example/
file .gitignore
file LICENSE
file README.md
file msg.go
file scp.go