Skip to content

Commit f4d34b4

Browse files
authored
Update README.md
1 parent 1a4f113 commit f4d34b4

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

+40-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,40 @@
1-
# scp
1+
# scp
2+
3+
A Simple `go` SCP client library
4+
5+
## Usage
6+
7+
```go
8+
import (
9+
"github.com/dtylman/scp"
10+
"golang.org/x/crypto/ssh"
11+
)
12+
```
13+
14+
## Sending Files
15+
16+
Copies `/var/log/messages` to remote `/tmp/lala`:
17+
18+
```go
19+
var sc* ssh.Client
20+
// establish ssh connection into sc here...
21+
n,err:=scp.CopyTo(sc, "/var/log/messages", "/tmp/lala")
22+
if err==nil{
23+
fmt.Printf("Sent %v bytes",n)
24+
}
25+
```
26+
27+
## Receiving Files
28+
29+
Copies remote `/var/log/message` to local `/tmp/lala`:
30+
31+
```go
32+
var sc* ssh.Client
33+
// establish ssh connection into sc here...
34+
n,err:=scp.CopyFrom(sc, "/var/log/message", "/tmp/lala")
35+
if err==nil{
36+
fmt.Printf("Sent %v bytes",n)
37+
}
38+
```
39+
40+

0 commit comments

Comments
 (0)