GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tickstep/cloudpan189-api: cloudpan189 go api

BranchesTags
Open more actions menu

Latest commit

 

History

52 Commits
52 Commits

Folders and files

NameName
Last commit message
Last commit date
cloudpan
cloudpan
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
test.go
test.go
 
 

Repository files navigation

cloudpan189-api

GO语言封装的 cloud 189 天翼云盘接口API。可以基于该接口库实现对天翼云盘的二次开发。

go.dev reference License

快速使用

导入包

import "github.com/tickstep/cloudpan189-api/cloudpan"

先调用登录接口,获取APP端cookie和WEB端cookie

	appToken, e := cloudpan.AppLogin("[email protected]", "123xxxxx")
	if e != nil {
		fmt.Println(e)
		return
	}

	webToken := &cloudpan.WebLoginToken{}
	webTokenStr := cloudpan.RefreshCookieToken(appToken.SessionKey)
	if webTokenStr != "" {
		webToken.CookieLoginUser = webTokenStr
	}
	fmt.Println("login success")

使用获取到的cookie创建PanClient实例

	// pan client
	panClient := cloudpan.NewPanClient(*webToken, *appToken)

调用PanClient相关方法可以实现对cloud189云盘的相关操作

	// do get file info action
	fi, err1 := panClient.FileInfoByPath("/我的文档")
	if err1 != nil {
		fmt.Println("get file info error")
		return
	}
	fmt.Printf("name = %s, size = %d, path = %s", fi.FileName, fi.FileSize, fi.Path)

About

cloudpan189 go api

Resources

Readme
Apache-2.0 license
Activity

Stars

37 stars

Watchers

4 watching

Forks

22 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.