telecom

package
v1.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenResp added in v0.9.3

type AccessTokenResp struct {
	// The expiry time for token, default 30 days.
	ExpiresIn   int64  `json:"expiresIn"`
	AccessToken string `json:"accessToken"`
}

type AppLoginParams added in v0.9.3

type AppLoginParams struct {
	CaptchaToken string
	Lt           string
	ReturnURL    string
	ParamID      string
	ReqID        string
	// contains filtered or unexported fields
}

type AppLoginResult added in v0.9.3

type AppLoginResult struct {
	Result int    `json:"result"`
	Msg    string `json:"msg"`
	ToURL  string `json:"toUrl"`
}

type AppLoginToken

type AppLoginToken struct {
	SessionKey              string `json:"sessionKey"`
	SessionSecret           string `json:"sessionSecret"`
	FamilySessionKey        string `json:"familySessionKey"`
	FamilySessionSecret     string `json:"familySessionSecret"`
	AccessToken             string `json:"accessToken"`
	RefreshToken            string `json:"refreshToken"`
	SskAccessToken          string `json:"sskAccessToken"`
	SskAccessTokenExpiresIn int64  `json:"sskAccessTokenExpiresIn"`
	RsaPublicKey            string `json:"rsaPublicKey"`
}

type AppSessionResp added in v0.9.3

type AppSessionResp struct {
	ResCode             int    `json:"res_code"`
	ResMessage          string `json:"res_message"`
	AccessToken         string `json:"accessToken"`
	FamilySessionKey    string `json:"familySessionKey"`
	FamilySessionSecret string `json:"familySessionSecret"`
	GetFileDiffSpan     int    `json:"getFileDiffSpan"`
	GetUserInfoSpan     int    `json:"getUserInfoSpan"`
	IsSaveName          string `json:"isSaveName"`
	KeepAlive           int    `json:"keepAlive"`
	LoginName           string `json:"loginName"`
	RefreshToken        string `json:"refreshToken"`
	SessionKey          string `json:"sessionKey"`
	SessionSecret       string `json:"sessionSecret"`
}

type ShareFile

type ShareFile struct {
	CreateDate string `json:"createDate"`
	FileCata   int    `json:"fileCata"`
	ID         int64  `json:"id"`
	LastOpTime string `json:"lastOpTime"`
	Md5        string `json:"md5"`
	MediaType  int    `json:"mediaType"`
	Name       string `json:"name"`
	Rev        string `json:"rev"`
	Size       int64  `json:"size"`
	StarLabel  int    `json:"starLabel"`
}

type ShareFiles

type ShareFiles struct {
	ResCode    int    `json:"res_code"`
	ResMessage string `json:"res_message"`
	ExpireTime int    `json:"expireTime"`
	ExpireType int    `json:"expireType"`
	FileListAO struct {
		Count        int           `json:"count"`
		FileList     []ShareFile   `json:"fileList"`
		FileListSize int64         `json:"fileListSize"`
		FolderList   []ShareFolder `json:"folderList"`
	} `json:"fileListAO"`
	LastRev int64 `json:"lastRev"`
}

type ShareFolder

type ShareFolder struct {
	CreateDate   string `json:"createDate"`
	FileCata     int    `json:"fileCata"`
	FileListSize int    `json:"fileListSize"`
	ID           int64  `json:"id"`
	LastOpTime   string `json:"lastOpTime"`
	Name         string `json:"name"`
	ParentID     int64  `json:"parentId"`
	Rev          string `json:"rev"`
	StarLabel    int    `json:"starLabel"`
}

type ShareInfo

type ShareInfo struct {
	ResCode        int    `json:"res_code"`
	ResMessage     string `json:"res_message"`
	AccessCode     string `json:"accessCode"`
	ExpireTime     int    `json:"expireTime"`
	ExpireType     int    `json:"expireType"`
	FileID         string `json:"fileId"`
	FileName       string `json:"fileName"`
	FileSize       int    `json:"fileSize"`
	IsFolder       bool   `json:"isFolder"`
	NeedAccessCode int    `json:"needAccessCode"`
	ShareDate      int64  `json:"shareDate"`
	ShareID        int64  `json:"shareId"`
	ShareMode      int    `json:"shareMode"`
	ShareType      int    `json:"shareType"`
}
type ShareLink struct {
	ResCode         int    `json:"res_code"`
	ResMessage      string `json:"res_message"`
	FileDownloadURL string `json:"fileDownloadUrl"`
}

type Telecom

type Telecom struct {
	*client.Client
	// contains filtered or unexported fields
}

func New

func New(c *client.Config, username, password string) (*Telecom, error)

func (*Telecom) DownloadFile

func (t *Telecom) DownloadFile(url string) (io.ReadCloser, error)

func (*Telecom) DownloadURL

func (t *Telecom) DownloadURL(shareCode, shareID, fileID string) (string, error)

func (*Telecom) ShareCode

func (t *Telecom) ShareCode(accessURL string) (string, error)

ShareCode extract the share code.

func (*Telecom) ShareFiles

func (t *Telecom) ShareFiles(accessURL, accessCode string) (*ShareInfo, []ShareFile, error)

ShareFiles will resolve the telecom-shared link.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL