Skip to content

Commit

Permalink
chore: remove go pusher by qiniu kodo
Browse files Browse the repository at this point in the history
  • Loading branch information
alomerry committed Apr 30, 2024
1 parent 5e36f14 commit 8255962
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
44 changes: 44 additions & 0 deletions modules/pusher/impl/aliyun.go
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
}
6 changes: 6 additions & 0 deletions modules/pusher/pusher.go
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
}

0 comments on commit 8255962

Please sign in to comment.