-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove go pusher by qiniu kodo
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package impl | ||
|
||
import ( | ||
"fmt" | ||
open "github.com/tickstep/aliyunpan-api/aliyunpan_open" | ||
"github.com/tickstep/aliyunpan-api/aliyunpan_open/openapi" | ||
) | ||
|
||
type AliyunPan struct { | ||
openPanClient *open.OpenPanClient | ||
} | ||
|
||
func (a *AliyunPan) Init() error { | ||
openPanClient := open.NewOpenPanClient(openapi.ApiConfig{ | ||
TicketId: "", | ||
UserId: "", | ||
ClientId: "", | ||
ClientSecret: "", | ||
}, openapi.ApiToken{ | ||
AccessToken: "eyJraWQiOiJLcU8iLC...jIUeqP9mZGZDrFLN--h1utcyVc", | ||
ExpiredAt: 1709527182, | ||
}, nil) | ||
|
||
// get user info | ||
ui, err := openPanClient.GetUserInfo() | ||
if err != nil { | ||
fmt.Println("get user info error") | ||
return err | ||
} | ||
fmt.Println("当前登录用户:" + ui.Nickname) | ||
|
||
// do some file operation | ||
fi, _ := openPanClient.FileInfoByPath(ui.FileDriveId, "/我的文档") | ||
fmt.Println("\n我的文档 信息:") | ||
fmt.Println(fi) | ||
|
||
//openPanClient.CreateUploadFile() | ||
return nil | ||
} | ||
|
||
func (a *AliyunPan) Push(filePath string, remotePath string) error { | ||
//a.openPanClient.CompleteUploadFile() | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package pusher | ||
|
||
type Pusher interface { | ||
Init() error | ||
Push(filePath string, remotePath string) error | ||
} |