修正模块名称.

Signed-off-by: chen.yang <chen.yang@yuzhen-iot.com>
This commit is contained in:
chen.yang 2022-02-25 11:34:46 +08:00
parent 9c7b272917
commit 0a08dd07fd
8 changed files with 23 additions and 23 deletions

View File

@ -24,7 +24,7 @@
## Install ## Install
`go get gitee.com/yuzhen-iot-team/ssh` `go get blacktea.vip.cpolar.top/OrgGo/ssh`
## Example ## Example
@ -40,7 +40,7 @@
package main package main
import ( import (
"fmt" "fmt"
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
) )
func main() { func main() {
@ -66,7 +66,7 @@ func main() {
package main package main
import ( import (
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
) )
func main() { func main() {
@ -78,7 +78,7 @@ func main() {
defer client.Close() defer client.Close()
var remotedir = "/root/test/" var remotedir = "/root/test/"
// download dir // 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) client.Download(remotedir, local)
// upload file // upload file
@ -95,7 +95,7 @@ func main() {
package main package main
import ( import (
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
) )
func main() { func main() {
@ -107,11 +107,11 @@ func main() {
defer client.Close() defer client.Close()
var remotedir = "/root/test/" var remotedir = "/root/test/"
// upload dir // 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) client.Upload(local, remotedir)
// upload file // 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) client.Upload(local, remotedir)
} }
``` ```

View File

@ -9,7 +9,7 @@ import (
"github.com/yeka/zip" "github.com/yeka/zip"
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
) )
var ( var (
@ -32,7 +32,7 @@ func main() {
fmt.Println(tmp) fmt.Println(tmp)
// var remotedir = "/root/test/" // var remotedir = "/root/test/"
// // download dir // // 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) // client.Download(remotedir, local)
// // download file // // download file

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"net" "net"
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
"github.com/go-sql-driver/mysql" "github.com/go-sql-driver/mysql"
) )

View File

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
) )
func main() { func main() {

View File

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
) )
func main() { func main() {

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"gitee.com/yuzhen-iot-team/ssh" "blacktea.vip.cpolar.top/OrgGo/ssh"
) )
func main() { func main() {
@ -13,10 +13,10 @@ func main() {
defer client.Close() defer client.Close()
var remotedir = "/root/test/" var remotedir = "/root/test/"
// upload dir // 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) client.Upload(local, remotedir)
// upload file // 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) client.Upload(local, remotedir)
} }

2
go.mod
View File

@ -1,4 +1,4 @@
module gitee.com/yuzhen-iot-team/ssh module blacktea.vip.cpolar.top/OrgGo/ssh
go 1.17 go 1.17

View File

@ -29,7 +29,7 @@ func GetClient() *Client {
func TestClient_Init(t *testing.T) { func TestClient_Init(t *testing.T) {
c := GetClient() c := GetClient()
defer c.Close() 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/" var remotedir = "/root/test/"
c.RemoveAll("/root/upload/") c.RemoveAll("/root/upload/")
@ -43,7 +43,7 @@ func TestClient_Upload(t *testing.T) {
c := GetClient() c := GetClient()
defer c.Close() 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{ var uploads = map[string][]string{
local + "null/": {"/root/upload/test/null/1", "/root/upload/test/null/2/"}, local + "null/": {"/root/upload/test/null/1", "/root/upload/test/null/2/"},
local + "null/": {"/root/upload/test/null/3", "/root/upload/test/null/4/"}, local + "null/": {"/root/upload/test/null/3", "/root/upload/test/null/4/"},
@ -69,7 +69,7 @@ func TestClient_Download(t *testing.T) {
c := GetClient() c := GetClient()
defer c.Close() 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{ var download = map[string][]string{
"/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"}, "/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"},
"/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"}, "/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"},
@ -96,7 +96,7 @@ func TestClient_DownloadFile(t *testing.T) {
c := GetClient() c := GetClient()
defer c.Close() 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{ var download = map[string][]string{
"/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"}, "/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"},
"/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"}, "/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"},
@ -121,7 +121,7 @@ func TestClient_DownloadDir(t *testing.T) {
c := GetClient() c := GetClient()
defer c.Close() 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{ var download = map[string][]string{
"/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"}, "/root/test/notExist": {local + "/localNotExist/null/1", local + "/localNotExist/null/2/"},
"/root/test/notExist/": {local + "/localNotExist/null/3", local + "/localNotExist/null/4/"}, "/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) { func TestClient_UploadFile(t *testing.T) {
c := GetClient() c := GetClient()
defer c.Close() 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{ 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/1", "/root/upload/file_test/null/2/"},
local + "null/": {"/root/upload/file_test/null/3", "/root/upload/file_test/null/4/"}, 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) { func TestClient_UploadDir(t *testing.T) {
c := GetClient() c := GetClient()
defer c.Close() 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{ 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/1", "/root/upload/dir_test/null/2/"},
local + "null/": {"/root/upload/dir_test/null/3", "/root/upload/dir_test/null/4/"}, local + "null/": {"/root/upload/dir_test/null/3", "/root/upload/dir_test/null/4/"},