Documentation ¶
Index ¶
- Constants
- Variables
- func CalcAcwScV2(html string) (string, error)
- func GetExpirationTime(url string) (etime time.Duration)
- func HexXor(hex1, hex2 string) string
- func IsNumber(str string) bool
- func MustParseTime(str string) time.Time
- func RemoveNotes(html string) string
- func SizeStrToInt64(size string) int64
- func Unbox(hex string) string
- type Addition
- type FileOrFolder
- func (f *FileOrFolder) GetID() string
- func (f *FileOrFolder) GetName() string
- func (f *FileOrFolder) GetPath() string
- func (f *FileOrFolder) GetShareInfo() *FileShare
- func (f *FileOrFolder) GetSize() int64
- func (f *FileOrFolder) IsDir() bool
- func (f *FileOrFolder) ModTime() time.Time
- func (f *FileOrFolder) SetShareInfo(fs *FileShare)
- type FileOrFolderByShareUrl
- type FileOrFolderByShareUrlResp
- type FileShare
- type FileShareInfoAndUrlResp
- type LanZou
- func (d *LanZou) Config() driver.Config
- func (d *LanZou) Drop(ctx context.Context) error
- func (d *LanZou) GetAddition() driver.Additional
- func (d *LanZou) GetAllFiles(folderID string) ([]model.Obj, error)
- func (d *LanZou) GetFileOrFolderByShareUrl(shareID, pwd string) ([]model.Obj, error)
- func (d *LanZou) GetFiles(folderID string) ([]FileOrFolder, error)
- func (d *LanZou) GetFilesByShareUrl(shareID, pwd string) (file *FileOrFolderByShareUrl, err error)
- func (d *LanZou) GetFolderByShareUrl(shareID, pwd string) ([]FileOrFolderByShareUrl, error)
- func (d *LanZou) GetFolders(folderID string) ([]FileOrFolder, error)
- func (d *LanZou) Init(ctx context.Context) (err error)
- func (d *LanZou) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *LanZou) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *LanZou) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)
- func (d *LanZou) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *LanZou) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) (model.Obj, error)
- func (d *LanZou) Remove(ctx context.Context, obj model.Obj) error
- func (d *LanZou) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
- type RespInfo
- type RespText
Constants ¶
View Source
const DAY time.Duration = 84600000000000
Variables ¶
View Source
var ErrFileNotExist = errors.New("file does not exist")
Functions ¶
func CalcAcwScV2 ¶
在页面被过多访问或其他情况下,有时候会先返回一个加密的页面,其执行计算出一个acw_sc__v2后放入页面后再重新访问页面才能获得正常页面 若该页面进行了js加密,则进行解密,计算acw_sc__v2,并加入cookie
func GetExpirationTime ¶ added in v3.9.0
Types ¶
type Addition ¶
type Addition struct { Type string `json:"type" type:"select" options:"cookie,url" default:"cookie"` Cookie string `json:"cookie" required:"true" help:"about 15 days valid, ignore if shareUrl is used"` driver.RootID BaseUrl string `json:"baseUrl" required:"true" default:"https://pc.woozooo.com" help:"basic URL for file operation"` RepairFileInfo bool `json:"repair_file_info" help:"To use webdav, you need to enable it"` }
type FileOrFolder ¶
type FileOrFolder struct { Name string `json:"name"` // 文件通用 ID string `json:"id"` NameAll string `json:"name_all"` Size string `json:"size"` Time string `json:"time"` // 文件夹 FolID string `json:"fol_id"` // contains filtered or unexported fields }
func (*FileOrFolder) GetID ¶ added in v3.9.0
func (f *FileOrFolder) GetID() string
func (*FileOrFolder) GetName ¶ added in v3.9.0
func (f *FileOrFolder) GetName() string
func (*FileOrFolder) GetPath ¶ added in v3.9.0
func (f *FileOrFolder) GetPath() string
func (*FileOrFolder) GetShareInfo ¶ added in v3.9.0
func (f *FileOrFolder) GetShareInfo() *FileShare
func (*FileOrFolder) GetSize ¶ added in v3.9.0
func (f *FileOrFolder) GetSize() int64
func (*FileOrFolder) IsDir ¶ added in v3.9.0
func (f *FileOrFolder) IsDir() bool
func (*FileOrFolder) ModTime ¶ added in v3.9.0
func (f *FileOrFolder) ModTime() time.Time
func (*FileOrFolder) SetShareInfo ¶ added in v3.9.0
func (f *FileOrFolder) SetShareInfo(fs *FileShare)
type FileOrFolderByShareUrl ¶
type FileOrFolderByShareUrl struct { // 文件特有 IsFloder bool `json:"-"` // // contains filtered or unexported fields }
func (*FileOrFolderByShareUrl) GetID ¶ added in v3.9.0
func (f *FileOrFolderByShareUrl) GetID() string
func (*FileOrFolderByShareUrl) GetName ¶ added in v3.9.0
func (f *FileOrFolderByShareUrl) GetName() string
func (*FileOrFolderByShareUrl) GetPath ¶ added in v3.9.0
func (f *FileOrFolderByShareUrl) GetPath() string
func (*FileOrFolderByShareUrl) GetSize ¶ added in v3.9.0
func (f *FileOrFolderByShareUrl) GetSize() int64
func (*FileOrFolderByShareUrl) IsDir ¶ added in v3.9.0
func (f *FileOrFolderByShareUrl) IsDir() bool
func (*FileOrFolderByShareUrl) ModTime ¶ added in v3.9.0
func (f *FileOrFolderByShareUrl) ModTime() time.Time
type FileShareInfoAndUrlResp ¶
获取下载链接的响应
func (*FileShareInfoAndUrlResp[T]) GetBaseUrl ¶
func (u *FileShareInfoAndUrlResp[T]) GetBaseUrl() string
func (*FileShareInfoAndUrlResp[T]) GetDownloadUrl ¶
func (u *FileShareInfoAndUrlResp[T]) GetDownloadUrl() string
type LanZou ¶
func (*LanZou) GetAddition ¶
func (d *LanZou) GetAddition() driver.Additional
func (*LanZou) GetAllFiles ¶ added in v3.9.0
获取文件和文件夹,获取到的文件大小、更改时间不可信
func (*LanZou) GetFileOrFolderByShareUrl ¶
通过分享链接获取文件或文件夹
func (*LanZou) GetFiles ¶
func (d *LanZou) GetFiles(folderID string) ([]FileOrFolder, error)
通过ID获取文件
func (*LanZou) GetFilesByShareUrl ¶ added in v3.9.0
func (d *LanZou) GetFilesByShareUrl(shareID, pwd string) (file *FileOrFolderByShareUrl, err error)
通过分享链接获取文件(下载链接也使用此方法) FileOrFolderByShareUrl 包含 pwd 和 url 字段 参考 https://github.com/zaxtyson/LanZouCloud-API/blob/ab2e9ec715d1919bf432210fc16b91c6775fbb99/lanzou/api/core.py#L440
func (*LanZou) GetFolderByShareUrl ¶ added in v3.9.0
func (d *LanZou) GetFolderByShareUrl(shareID, pwd string) ([]FileOrFolderByShareUrl, error)
通过分享链接获取文件夹 似乎子目录和文件不会加密 参考 https://github.com/zaxtyson/LanZouCloud-API/blob/ab2e9ec715d1919bf432210fc16b91c6775fbb99/lanzou/api/core.py#L1089
func (*LanZou) GetFolders ¶ added in v3.9.0
func (d *LanZou) GetFolders(folderID string) ([]FileOrFolder, error)
通过ID获取文件夹
Click to show internal directories.
Click to hide internal directories.