podman/vendor/github.com/dtylman/scp
cdoern 1d10ca739f Created scp.go image_scp_test.go and podman-image-scp.1.md
added functionality for image secure copying from local to remote.
Also moved system connection add code around a bit so functions within that file
can be used by scp.

Signed-off-by: cdoern <cdoern@redhat.com>
2021-07-30 17:19:24 -04:00
..
.gitignore Created scp.go image_scp_test.go and podman-image-scp.1.md 2021-07-30 17:19:24 -04:00
LICENSE Created scp.go image_scp_test.go and podman-image-scp.1.md 2021-07-30 17:19:24 -04:00
msg.go Created scp.go image_scp_test.go and podman-image-scp.1.md 2021-07-30 17:19:24 -04:00
README.md Created scp.go image_scp_test.go and podman-image-scp.1.md 2021-07-30 17:19:24 -04:00
scp.go Created scp.go image_scp_test.go and podman-image-scp.1.md 2021-07-30 17:19:24 -04:00

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)
}