Documentation
¶
Index ¶
- Constants
- func AppKeySignatureHeader(url, method string) map[string]string
- func AppKeySignatureOfHmac(sessionSecret, appKey, operate, fullUrl string, timestamp int64) string
- type AccessCount
- type AccessTokenResponse
- type ApiURL
- type AppSessionResp
- type AuthToken
- type Client
- type E189AccessTokenResp
- type FamilyGetFileDownloadOption
- type FamilyGetFileDownloadRequest
- type FamilyGetFileDownloadResponse
- type FamilyInfo
- type FamilyListFilesRequest
- type FileInfo
- type FolderInfo
- type GetFamilyListResponse
- type GetFileDownloadOption
- type GetFileDownloadRequest
- type GetFileDownloadResponse
- type GetFileFileOption
- type GetFileInfoRequest
- type GetFileInfoResponse
- type GetFolderFileOption
- type GetFolderInfoRequest
- type GetFolderInfoResponse
- type GetNewVLCVideoPlayURLRequest
- type GetNewVLCVideoPlayURLResponse
- type GetShareInfoOption
- type GetShareInfoRequest
- type GetShareInfoResponse
- type GetUpResourceShareRequest
- type GetUpResourceShareRequestOption
- type GetUpResourceShareResponse
- type GetUserInfoResponse
- type GetUserPrivilegesResponse
- type ListFilesRequest
- type ListFilesResponse
- type ListResourceShareFileRequest
- type ListShareFileRequest
- type ListShareFileResponse
- type RespErr
- type ShareFileInfo
- type ShareFileList
- type String
- type SubscribeGetUserInfo
- type SubscribeGetUserRequest
- type SubscribeGetUserResponse
- type UUIDInfoResp
- type UserSessionResp
- type WithFamilyListFilesRequestOption
- type WithGetNewVLCVideoPlayURLRequestOption
- type WithListFilesRequestOption
- type WithListResourceShareDirRequestOption
- type WithListShareFileRequestOption
Constants ¶
View Source
const ( ApiGetFileInfo = "/open/file/getFileInfo.action" ApiGetFileDownloadURL = "/open/file/getFileDownloadUrl.action" ApiGetFolderInfo = "/open/file/getFolderInfo.action" ApiGetNewVLCVideoPlayURL = "/open/file/getNewVlcVideoPlayUrl.action" ApiGetUserInfo = "/open/user/getUserInfo.action" ApiGetUserPrivileges = "/open/user/getUserPrivileges.action" ApiListFiles = "/open/file/listFiles.action" ApiGetFamilyList = "/open/family/manage/getFamilyList.action" ApiFamilyListFiles = "/open/family/file/listFiles.action" ApiFamilyGetFileDownloadURL = "/open/family/file/getFileDownloadUrl.action" ApiSubscribeGetUser = "/open/subscribe/getUser.action" )
View Source
const ( TVAppKey = "600100885" TVAppSignatureSecret = "fe5734c74c2f96a38157f420b32dc995" TvVersion = "6.5.5" AndroidTV = "FAMILY_TV" TvChannelId = "home02" ApiUrl = "https://api.cloud.189.cn" UserAgent = "EcloudTV/6.5.5 (PJX110; unknown; home02) Android/35" Accept = "application/json;charset=UTF-8" DefaultTimeout = time.Second * 30 )
Variables ¶
This section is empty.
Functions ¶
func AppKeySignatureHeader ¶
func AppKeySignatureOfHmac ¶
AppKeySignatureOfHmac HMAC签名
Types ¶
type AccessCount ¶
type AccessTokenResponse ¶
type AccessTokenResponse struct {
ExpiresIn int64 `json:"expiresIn"`
AccessToken string `json:"accessToken"`
}
func LoginQuery ¶
func LoginQuery(uuid string) (*AccessTokenResponse, error)
type AppSessionResp ¶
type AppSessionResp struct {
UserSessionResp
IsSaveName string `json:"isSaveName"`
// 会话刷新Token
AccessToken string `json:"accessToken"`
//Token刷新
RefreshToken string `json:"refreshToken"`
}
AppSessionResp 登录返回
type AuthToken ¶
type AuthToken interface {
IsExpired() bool
ExpireTime() string
ExpireDuration() time.Duration
AccessToken() string
}
func NewAuthToken ¶
type Client ¶
type Client interface {
WithDebug(flags ...bool) Client
WithToken(token AuthToken) Client
WithForceWithToken(flags ...bool) Client
WithClient(client *resty.Client) Client
GetFileDownload(ctx context.Context, fileId String, opts ...GetFileDownloadOption) (*GetFileDownloadResponse, error)
GetFileInfo(ctx context.Context, fileId String, opts ...GetFileFileOption) (*GetFileInfoResponse, error)
GetFolderInfo(ctx context.Context, folder String, opts ...GetFolderFileOption) (*GetFolderInfoResponse, error)
GetNewVLCVideoPlayURL(ctx context.Context, fileId String, opts ...WithGetNewVLCVideoPlayURLRequestOption) (*GetNewVLCVideoPlayURLResponse, error)
GetUserInfo(ctx context.Context) (*GetUserInfoResponse, error)
GetUserPrivileges(ctx context.Context) (*GetUserPrivilegesResponse, error)
ListFiles(ctx context.Context, folderId String, opts ...WithListFilesRequestOption) (*ListFilesResponse, error)
GetFamilyList(ctx context.Context) (*GetFamilyListResponse, error)
FamilyListFiles(ctx context.Context, familyId String, folderId String, opts ...WithFamilyListFilesRequestOption) (*ListFilesResponse, error)
FamilyGetFileDownload(ctx context.Context, familyId String, fileId String, opts ...FamilyGetFileDownloadOption) (*FamilyGetFileDownloadResponse, error)
SubscribeGetUser(ctx context.Context, userId string) (*SubscribeGetUserResponse, error)
}
type E189AccessTokenResp ¶
type FamilyGetFileDownloadOption ¶ added in v1.0.3
type FamilyGetFileDownloadOption func(*FamilyGetFileDownloadRequest)
type FamilyGetFileDownloadRequest ¶ added in v1.0.3
type FamilyGetFileDownloadResponse ¶ added in v1.0.3
type FamilyGetFileDownloadResponse struct {
FileDownloadUrl string `json:"fileDownloadUrl"`
}
type FamilyInfo ¶ added in v1.0.3
type FamilyListFilesRequest ¶ added in v1.0.3
type FileInfo ¶
type FileInfo struct {
CreateDate string `json:"createDate"`
FileCata int `json:"fileCata"`
Id String `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"`
Orientation int `json:"orientation,omitempty"`
}
type FolderInfo ¶
type FolderInfo struct {
CreateDate string `json:"createDate"`
FileCata int `json:"fileCata"`
FileCount int `json:"fileCount"`
FileListSize int `json:"fileListSize"`
Id String `json:"id"`
LastOpTime string `json:"lastOpTime"`
Name string `json:"name"`
ParentId String `json:"parentId"`
Rev string `json:"rev"`
StarLabel int `json:"starLabel"`
}
type GetFamilyListResponse ¶ added in v1.0.3
type GetFamilyListResponse struct {
FamilyInfoResp []FamilyInfo `json:"familyInfoResp"`
}
type GetFileDownloadOption ¶
type GetFileDownloadOption func(*GetFileDownloadRequest)
type GetFileDownloadRequest ¶
type GetFileDownloadResponse ¶
type GetFileFileOption ¶
type GetFileFileOption func(*GetFileInfoRequest)
type GetFileInfoRequest ¶
type GetFileInfoResponse ¶
type GetFileInfoResponse struct {
ResCode int `json:"res_code"`
ResMessage string `json:"res_message"`
CreateDate string `json:"createDate"`
FileDownloadUrl string `json:"fileDownloadUrl"`
FilePath string `json:"filePath"`
Id String `json:"id"`
LastOpTime int64 `json:"lastOpTime"`
LastOpTimeStr string `json:"lastOpTimeStr"`
Md5 string `json:"md5"`
Name string `json:"name"`
ParentId String `json:"parentId"`
Rev int64 `json:"rev"`
Size int `json:"size"`
}
type GetFolderFileOption ¶
type GetFolderFileOption func(*GetFolderInfoRequest)
type GetFolderInfoRequest ¶
type GetFolderInfoResponse ¶
type GetFolderInfoResponse struct {
ResCode int `json:"res_code"`
ResMessage string `json:"res_message"`
CreateDate string `json:"createDate"` // 文件夹创建日期(YYYY-MM-DD hh:mm:ss)
CreateTime int64 `json:"createTime"` // 文件夹创建时间(13位时间戳)
FileId String `json:"fileId"` // 文件夹ID
FileName string `json:"fileName"` // 文件夹名称
FilePath string `json:"filePath"` // 文件夹路径
LastOpTime int64 `json:"lastOpTime"` // 上次修改时间(13位时间戳)
LastOpTimeStr string `json:"lastOpTimeStr"` // 上次修改时间(YYYY-MM-DD hh:mm:ss)
ParentId String `json:"parentId"` // 父文件夹ID
Rev int64 `json:"rev"` // 文件夹版本号
}
type GetShareInfoOption ¶
type GetShareInfoOption func(*GetShareInfoRequest)
type GetShareInfoRequest ¶
type GetShareInfoRequest struct {
}
type GetShareInfoResponse ¶
type GetUpResourceShareRequest ¶
type GetUpResourceShareRequest struct {
}
type GetUpResourceShareRequestOption ¶
type GetUpResourceShareRequestOption func(*GetUpResourceShareRequest)
type GetUpResourceShareResponse ¶
type GetUpResourceShareResponse struct {
}
type GetUserInfoResponse ¶
type GetUserInfoResponse struct {
ResCode int `json:"res_code"`
ResMessage string `json:"res_message"`
Available int64 `json:"available"`
Capacity int64 `json:"capacity"`
ExtPicAvailable int `json:"extPicAvailable"`
ExtPicCapacity int `json:"extPicCapacity"`
ExtPicUsed int `json:"extPicUsed"`
HasFamily int `json:"hasFamily"`
LoginName string `json:"loginName"`
Mail189UsedSize int `json:"mail189UsedSize"`
MaxFilesize float64 `json:"maxFilesize"`
OrderAmount int `json:"orderAmount"`
ProvinceCode string `json:"provinceCode"`
UEncrypt string `json:"uEncrypt"`
UMd5 string `json:"uMd5"`
}
type GetUserPrivilegesResponse ¶
type GetUserPrivilegesResponse struct {
ResCode int `json:"res_code"`
ResMessage string `json:"res_message"`
BeginTime string `json:"beginTime"`
ChannelId string `json:"channelId"`
EndTime string `json:"endTime"`
IsNetSDKOpen string `json:"isNetSDKOpen"`
PackOverLimitSize int64 `json:"packOverLimitSize"`
PicEditRemainTimes int `json:"picEditRemainTimes"`
PicEditTotalTimes int `json:"picEditTotalTimes"`
PreDecomp int64 `json:"preDecomp"`
TransChannel int `json:"transChannel"`
TransConcurrent int `json:"transConcurrent"`
TransDayFlow int64 `json:"transDayFlow"`
TransDownSpeed int `json:"transDownSpeed"` // 可以排查有没有被限速
TransFileSize float64 `json:"transFileSize"`
TransQos int `json:"transQos"`
TransSpeed int `json:"transSpeed"`
TransVideo int `json:"transVideo"`
TryNum int `json:"tryNum"`
UsedDayFlow int `json:"usedDayFlow"`
UserLevel int `json:"userLevel"`
VipExpiredTime string `json:"vipExpiredTime"`
}
type ListFilesRequest ¶ added in v1.0.3
type ListFilesResponse ¶
type ListFilesResponse struct {
ResCode int `json:"res_code"`
ResMessage string `json:"res_message"`
FileListAO struct {
Count int64 `json:"count"`
FileList []FileInfo `json:"fileList"`
FileListSize int64 `json:"fileListSize"`
FolderList []FolderInfo `json:"folderList"`
} `json:"fileListAO"`
LastRev int64 `json:"lastRev"`
}
type ListResourceShareFileRequest ¶
type ListResourceShareFileRequest struct {
}
type ListShareFileRequest ¶
type ListShareFileRequest struct {
}
type ListShareFileResponse ¶
type ListShareFileResponse struct {
Count int64 `json:"count"`
FileList []FileInfo `json:"fileList"`
FileListSize int64 `json:"fileListSize"`
FolderList []FolderInfo `json:"folderList"`
} `json:"fileListAO"`
}
type RespErr ¶
type RespErr struct {
ResCode any `json:"res_code"` // int or string
ResMessage string `json:"res_message"`
Error_ string `json:"error"`
XMLName xml.Name `xml:"error"`
Code string `json:"code" xml:"code"`
Message string `json:"message" xml:"message"`
Msg string `json:"msg"`
ErrorCode string `json:"errorCode"`
ErrorMsg string `json:"errorMsg"`
}
RespErr 居然有四种返回方式
type ShareFileInfo ¶
type ShareFileInfo struct {
}
type ShareFileList ¶
type ShareFileList struct {
}
type SubscribeGetUserInfo ¶ added in v1.0.2
type SubscribeGetUserInfo struct {
Id int64 `json:"id"`
UserId string `json:"userId"`
Name string `json:"name"`
Picture string `json:"picture"`
FansNum int `json:"fansNum"`
FollowNum int `json:"followNum"`
Status int `json:"status"`
Ip interface{} `json:"ip"`
IsVip int `json:"isVip"`
IsFirstSubscribe int `json:"isFirstSubscribe"`
Phone string `json:"phone"`
Brief interface{} `json:"brief"`
OrderNum interface{} `json:"orderNum"`
ExtendOne string `json:"extendOne"`
ExtendTwo string `json:"extendTwo"`
CreateTime time.Time `json:"createTime"`
UpdateTime time.Time `json:"updateTime"`
PushSwitch int `json:"pushSwitch"`
ExtendThree interface{} `json:"extendThree"`
ExtendFour interface{} `json:"extendFour"`
IsFollow interface{} `json:"isFollow"`
}
type SubscribeGetUserRequest ¶ added in v1.0.2
type SubscribeGetUserRequest struct {
UserId string `url:"userId"`
}
type SubscribeGetUserResponse ¶ added in v1.0.2
type SubscribeGetUserResponse struct {
Code string `json:"code"`
Msg string `json:"msg"`
Data SubscribeGetUserInfo `json:"data"`
}
type UUIDInfoResp ¶
type UUIDInfoResp struct {
UUID string `json:"uuid"`
}
func LoginInit ¶
func LoginInit() (*UUIDInfoResp, error)
type UserSessionResp ¶
type UserSessionResp struct {
ResCode int `json:"res_code"`
ResMessage string `json:"res_message"`
LoginName string `json:"loginName"`
KeepAlive int `json:"keepAlive"`
GetFileDiffSpan int `json:"getFileDiffSpan"`
GetUserInfoSpan int `json:"getUserInfoSpan"`
// 个人云
SessionKey string `json:"sessionKey"`
SessionSecret string `json:"sessionSecret"`
// 家庭云
FamilySessionKey string `json:"familySessionKey"`
FamilySessionSecret string `json:"familySessionSecret"`
}
type WithFamilyListFilesRequestOption ¶ added in v1.0.3
type WithFamilyListFilesRequestOption func(*FamilyListFilesRequest)
type WithGetNewVLCVideoPlayURLRequestOption ¶
type WithGetNewVLCVideoPlayURLRequestOption func(*GetNewVLCVideoPlayURLRequest)
type WithListFilesRequestOption ¶ added in v1.0.3
type WithListFilesRequestOption func(*ListFilesRequest)
type WithListResourceShareDirRequestOption ¶
type WithListResourceShareDirRequestOption func(*ListResourceShareFileRequest)
type WithListShareFileRequestOption ¶
type WithListShareFileRequestOption func(*ListShareFileRequest)
Source Files
¶
- api.go
- api_family_get_file_download_url.go
- api_family_list_files.go
- api_get_family_list.go
- api_get_file_download_url.go
- api_get_file_info.go
- api_get_folder_info.go
- api_get_new_vlc_video_play_url.go
- api_get_share_info.go
- api_get_up_resource_share.go
- api_get_user_info.go
- api_get_user_privileges.go
- api_list_files.go
- api_list_resource_share_dir.go
- api_list_share_dir.go
- api_subscribe_get_user.go
- client.go
- client_core.go
- consts.go
- init.go
- lib.go
- login.go
- token.go
- types.go
- utils.go
Click to show internal directories.
Click to hide internal directories.