修正模块名称.
Signed-off-by: chen.yang <chen.yang@yuzhen-iot.com>
This commit is contained in:
parent
9c7b272917
commit
0a08dd07fd
14
README.md
14
README.md
|
@ -24,7 +24,7 @@
|
|||
|
||||
## Install
|
||||
|
||||
`go get gitee.com/yuzhen-iot-team/ssh`
|
||||
`go get blacktea.vip.cpolar.top/OrgGo/ssh`
|
||||
|
||||
## Example
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
|||
package main
|
||||
import (
|
||||
"fmt"
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
)
|
||||
func main() {
|
||||
|
||||
|
@ -66,7 +66,7 @@ func main() {
|
|||
package main
|
||||
|
||||
import (
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -78,7 +78,7 @@ func main() {
|
|||
defer client.Close()
|
||||
var remotedir = "/root/test/"
|
||||
// download dir
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/download/"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/download/"
|
||||
client.Download(remotedir, local)
|
||||
|
||||
// upload file
|
||||
|
@ -95,7 +95,7 @@ func main() {
|
|||
package main
|
||||
|
||||
import (
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -107,11 +107,11 @@ func main() {
|
|||
defer client.Close()
|
||||
var remotedir = "/root/test/"
|
||||
// upload dir
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/"
|
||||
client.Upload(local, remotedir)
|
||||
|
||||
// upload file
|
||||
local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/file"
|
||||
local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/file"
|
||||
client.Upload(local, remotedir)
|
||||
}
|
||||
```
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
"github.com/yeka/zip"
|
||||
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -32,7 +32,7 @@ func main() {
|
|||
fmt.Println(tmp)
|
||||
// var remotedir = "/root/test/"
|
||||
// // download dir
|
||||
// var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/download/"
|
||||
// var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/download/"
|
||||
// client.Download(remotedir, local)
|
||||
|
||||
// // download file
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"gitee.com/yuzhen-iot-team/ssh"
|
||||
"blacktea.vip.cpolar.top/OrgGo/ssh"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -13,10 +13,10 @@ func main() {
|
|||
defer client.Close()
|
||||
var remotedir = "/root/test/"
|
||||
// upload dir
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/"
|
||||
client.Upload(local, remotedir)
|
||||
// upload file
|
||||
local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/file"
|
||||
local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/file"
|
||||
client.Upload(local, remotedir)
|
||||
|
||||
}
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
|||
module gitee.com/yuzhen-iot-team/ssh
|
||||
module blacktea.vip.cpolar.top/OrgGo/ssh
|
||||
|
||||
go 1.17
|
||||
|
||||
|
|
14
sftp_test.go
14
sftp_test.go
|
@ -29,7 +29,7 @@ func GetClient() *Client {
|
|||
func TestClient_Init(t *testing.T) {
|
||||
c := GetClient()
|
||||
defer c.Close()
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/"
|
||||
|
||||
var remotedir = "/root/test/"
|
||||
c.RemoveAll("/root/upload/")
|
||||
|
@ -43,7 +43,7 @@ func TestClient_Upload(t *testing.T) {
|
|||
c := GetClient()
|
||||
defer c.Close()
|
||||
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/"
|
||||
var uploads = map[string][]string{
|
||||
local + "null/": {"/root/upload/test/null/1", "/root/upload/test/null/2/"},
|
||||
local + "null/": {"/root/upload/test/null/3", "/root/upload/test/null/4/"},
|
||||
|
@ -69,7 +69,7 @@ func TestClient_Download(t *testing.T) {
|
|||
c := GetClient()
|
||||
defer c.Close()
|
||||
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/download"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/download"
|
||||
var download = map[string][]string{
|
||||
"/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"},
|
||||
"/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"},
|
||||
|
@ -96,7 +96,7 @@ func TestClient_DownloadFile(t *testing.T) {
|
|||
c := GetClient()
|
||||
defer c.Close()
|
||||
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/downloadfile"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/downloadfile"
|
||||
var download = map[string][]string{
|
||||
"/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"},
|
||||
"/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"},
|
||||
|
@ -121,7 +121,7 @@ func TestClient_DownloadDir(t *testing.T) {
|
|||
c := GetClient()
|
||||
defer c.Close()
|
||||
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/downloaddir"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/downloaddir"
|
||||
var download = map[string][]string{
|
||||
"/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"},
|
||||
"/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"},
|
||||
|
@ -145,7 +145,7 @@ func TestClient_DownloadDir(t *testing.T) {
|
|||
func TestClient_UploadFile(t *testing.T) {
|
||||
c := GetClient()
|
||||
defer c.Close()
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/"
|
||||
var uploads = map[string][]string{
|
||||
local + "null": {"/root/upload/file_test/null/1", "/root/upload/file_test/null/2/"},
|
||||
local + "null/": {"/root/upload/file_test/null/3", "/root/upload/file_test/null/4/"},
|
||||
|
@ -170,7 +170,7 @@ func TestClient_UploadFile(t *testing.T) {
|
|||
func TestClient_UploadDir(t *testing.T) {
|
||||
c := GetClient()
|
||||
defer c.Close()
|
||||
var local = "/home/ubuntu/go/src/gitee.com/yuzhen-iot-team/ssh/test/upload/"
|
||||
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/"
|
||||
var uploads = map[string][]string{
|
||||
local + "null/": {"/root/upload/dir_test/null/1", "/root/upload/dir_test/null/2/"},
|
||||
local + "null/": {"/root/upload/dir_test/null/3", "/root/upload/dir_test/null/4/"},
|
||||
|
|
Loading…
Reference in New Issue