spiegel_podman/vendor/github.com/dtylman/scp
tomsweeneyredhat 2ba0070cc4
Bump runc to 1.2.9, Buildah 1.29.6
Cherry picked from commit 2e8bce201e with
additional updates required for the v4.2.0-rhel branch.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>

Assisted by AI: Cursor <Auto>
Signed-off-by: Chris Evich <cevich@redhat.com>
2026-01-28 10:45:58 -05:00
..
.gitignore Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05: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 Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05: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 Bump runc to 1.2.9, Buildah 1.29.6 2026-01-28 10:45:58 -05: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)
}