Versions in this module Expand all Collapse all v0 v0.1.3 Oct 31, 2023 Changes in this version + type SafeBoxCheckStatusData struct + NeedNotice any + PwdFailLimit any + PwdRetryCnt int + SafeBoxDirkey string + SafeBoxPdirkey string + type SafeBoxPublicKeyGetData struct + PublicKey string type WeiYunClient + func (c *WeiYunClient) SafeBoxCheckStatus(opts ...RestyOption) (*SafeBoxCheckStatusData, error) + func (c *WeiYunClient) SafeBoxPublicKeyGet(opts ...RestyOption) (*SafeBoxPublicKeyGetData, error) + func (c *WeiYunClient) WeiyunSafeBoxRequest(name string, cmd int, data Json, resp any, opts ...RestyOption) ([]byte, error) v0.1.2 Aug 8, 2023 v0.1.1 Jul 31, 2023 Changes in this version + const FileAndDir + const OnlyDir + const OnlyFile + var ErrCode403 = errors.New("http code 403") + var ErrCookieExpiration = errors.New("the login cookie is invalid, please login in again") + var ErrTokenExpiration = errors.New("token expiration") + var ErrTokenIsNil = errors.New("token is nil") + func ClearCookie(cookies []*http.Cookie) []*http.Cookie + func CookieToString(cookies []*http.Cookie) string + func GetCookieValue(name string, cks []*http.Cookie) string + func GetDirFileIDFormUrl(url string) string + func GetHash33(d string) string + func GetSha1State(h hash.Hash) []byte + func MustJsonMarshalToString(v any) string + func MustSliceConvert(srcS []S, convert func(src S) D) []D + func ParseCookieStr(str string) []*http.Cookie + func RandomT() string + func SetCookieValue(name string, value string, cks []*http.Cookie) + func SliceContains(arrs []T, v T, contains func(arr, v T) bool) bool + func SliceConvert(srcS []S, convert func(src S) (D, error)) ([]D, error) + type AddChannelData struct + AddChannels []struct{ ... } + FinalChannelCount int + OrigChannelCount int + OrigChannels []struct{ ... } + type DiskDirFileBatchListParam struct + DirKey string + ParamOption []ParamOption + type DiskFileDownloadData struct + CookieName string + CookieValue string + DownloadUrl string + Retcode int + Retmsg string + type DiskFilePackageDownloadParam struct + PdirKey string + PdirList any + type DiskListData struct + DirList []Folder + FileList []File + FinishFlag bool + HideDirCount int + HideFileCount int + PdirKey string + TotalDirCount int + TotalFileCount int + TotalSpace int + type DiskUserInfoGetData struct + DirTotal int64 + FileTotal int64 + HeadImgUrl string + MainDirKey string + NickName string + RootDirKey string + TotalSpace int64 + Uin int64 + UsedSpace int64 + UserCtime TimeStamp + UserMtime TimeStamp + type File struct + ExtInfo struct{ ... } + FileCtime TimeStamp + FileID string + FileMtime TimeStamp + FileName string + FileSha string + FileSize int64 + type FileParam struct + FileID string + FileName string + PPdirKey string + PdirKey string + type Folder struct + DirCtime TimeStamp + DirKey string + DirMtime TimeStamp + DirName string + type FolderParam struct + DirKey string + DirName string + PPdirKey string + PdirKey string + type FolderPath struct + PdirKey string + type GetType int8 + type Json map[string]any + func ApplyParamOption(param Json, option ...ParamOption) Json + func NewBody(cmdName string, data, tokenInfo Json) Json + func NewHeader(cmd int, tokenInfo Json) Json + type OpenApiErron struct + ErrCode int + ErrMsg string + func (e *OpenApiErron) Error() string + func (e *OpenApiErron) IsError() bool + type OpenApiToken struct + AccessToken string + ExpiresIn int + RefreshToken string + TokenType string + type OrderBy int8 + const FileMtime + const FileName + const FileSize + type ParamOption func(Json) + func QueryFileOptionCount(size int) ParamOption + func QueryFileOptionGetType(t GetType) ParamOption + func QueryFileOptionOffest(start int64) ParamOption + func QueryFileOptionSort(orderBy OrderBy, desc bool) ParamOption + func WarpParamOption(option ...ParamOption) []ParamOption + type PreUploadData struct + ChannelList []UploadChannelData + File File + FileExist bool + FlowState int + Speedlimit int + UploadScr int + UploadState int + UploadedDataLen int + type Resp struct + Code int + Data ... + Msg string + func (r *Resp) Error() string + func (r *Resp) GetBody() json.RawMessage + func (r *Resp) GetHeader() RespHeader + func (r *Resp) HasError() bool + type RespHeader struct + Cmd int + CmdName string + Encrypt int + Retcode int + Retmsg string + Seq int64 + Type int + Uin int64 + ZipFlag int + type RestyOption func(request *resty.Request) + type TimeStamp time.Time + func (t *TimeStamp) UnmarshalJSON(b []byte) error + type UpdloadFileParam struct + ChannelCount int + DirKey string + File io.ReadSeeker + FileExistOption int + FileName string + FileSize int64 + PdirKey string + type UploadAuthData struct + Ex string + UploadKey string + type UploadChannelData struct + ID int + Len int + Offset int64 + type UploadPieceData struct + Channel UploadChannelData + Ex string + FlowState int + UploadState int + type WeiXinRefreshTokenData struct + AccessToken string + ExpiresIn int + Openid string + RefreshToken string + Scope string + type WeiYunClient struct + Client *resty.Client + func NewWeiYunClient() *WeiYunClient + func NewWeiYunClientWithRestyClient(client *resty.Client) *WeiYunClient + func (c *WeiYunClient) AddUploadChannel(origChannelCount, destChannelCount int, auth UploadAuthData, ...) (*AddChannelData, error) + func (c *WeiYunClient) DiskDirAttrModify(dParam FolderParam, newDirName string, opts ...RestyOption) error + func (c *WeiYunClient) DiskDirCreate(dParam FolderParam, opts ...RestyOption) (*Folder, error) + func (c *WeiYunClient) DiskDirDelete(dParam FolderParam, opts ...RestyOption) error + func (c *WeiYunClient) DiskDirFileBatchList(batchParam []DiskDirFileBatchListParam, commonParamOption []ParamOption, ...) ([]DiskListData, error) + func (c *WeiYunClient) DiskDirFileList(dirKey string, paramOption []ParamOption, opts ...RestyOption) (*DiskListData, error) + func (c *WeiYunClient) DiskDirMove(srcParam FolderParam, dstParam FolderParam, opts ...RestyOption) error + func (c *WeiYunClient) DiskFileBatchDownload(fParam []FileParam, opts ...RestyOption) ([]DiskFileDownloadData, error) + func (c *WeiYunClient) DiskFileDelete(fParam FileParam, opts ...RestyOption) error + func (c *WeiYunClient) DiskFileDownload(fParam FileParam, opts ...RestyOption) (*DiskFileDownloadData, error) + func (c *WeiYunClient) DiskFileMove(srcParam FileParam, dstParam FolderParam, opts ...RestyOption) error + func (c *WeiYunClient) DiskFilePackageDownload(param []DiskFilePackageDownloadParam, zipFilename string, opts ...RestyOption) (*DiskFileDownloadData, error) + func (c *WeiYunClient) DiskFileRename(fParam FileParam, newFileName string, opts ...RestyOption) error + func (c *WeiYunClient) DiskUserInfoGet(opts ...RestyOption) (*DiskUserInfoGetData, error) + func (c *WeiYunClient) GetCookieJar() http.CookieJar + func (c *WeiYunClient) GetCookies() []*http.Cookie + func (c *WeiYunClient) KeepAlive() error + func (c *WeiYunClient) LibDirPathGet(dirKey string, opts ...RestyOption) ([]FolderPath, error) + func (c *WeiYunClient) LoginType() int8 + func (c *WeiYunClient) ParseTokenInfo() Json + func (c *WeiYunClient) PreUpload(ctx context.Context, param UpdloadFileParam, opts ...RestyOption) (*PreUploadData, error) + func (c *WeiYunClient) QQFastLogin(ctx context.Context, qq string) ([]*http.Cookie, error) + func (c *WeiYunClient) QQLoginInit(ctx context.Context) (appid, daid, callbackURL string, err error) + func (c *WeiYunClient) QQQRLogin(ctx context.Context, showQR func([]byte) error) ([]*http.Cookie, error) + func (c *WeiYunClient) RefreshCtoken() error + func (c *WeiYunClient) Request(protocol, name string, cmd int, data Json, resp any, opts ...RestyOption) ([]byte, error) + func (c *WeiYunClient) SetClient(client *http.Client) *WeiYunClient + func (c *WeiYunClient) SetCookies(cks []*http.Cookie) *WeiYunClient + func (c *WeiYunClient) SetCookiesStr(str string) *WeiYunClient + func (c *WeiYunClient) SetOnCookieExpired(onCookieExpired func(error)) + func (c *WeiYunClient) SetOnCookieUpload(onCookieUpload func([]*http.Cookie)) + func (c *WeiYunClient) SetProxy(proxy string) *WeiYunClient + func (c *WeiYunClient) SetRestyClient(client *resty.Client) *WeiYunClient + func (c *WeiYunClient) UploadFile(ctx context.Context, channel UploadChannelData, auth UploadAuthData, ...) (*UploadPieceData, error) + func (c *WeiYunClient) UploadRequest(name string, cmd int, data Json, resp any, opts ...RestyOption) ([]byte, error) + func (c *WeiYunClient) WeiXinQRLogin(ctx context.Context, showQR func([]byte) error) ([]*http.Cookie, error) + func (c *WeiYunClient) WeiXinRefreshToken() (*WeiXinRefreshTokenData, error) + func (c *WeiYunClient) WeiyunFileLibClientRequest(name string, cmd int, data Json, resp any, opts ...RestyOption) ([]byte, error) + func (c *WeiYunClient) WeiyunQdiskClientRequest(name string, cmd int, data Json, resp any, opts ...RestyOption) ([]byte, error) + func (c *WeiYunClient) WeiyunQdiskRequest(name string, cmd int, data Json, resp any, opts ...RestyOption) ([]byte, error) v0.1.0 Jul 31, 2023