Documentation ¶
Index ¶
- Variables
- func FilterEmoji(content string) string
- type CreateFile
- type CreateFileParam
- type ErrorResponse
- type NetDisk
- func (d *NetDisk) AuthorizeURI(registeredUrl string, display string) string
- func (d *NetDisk) AutoRefreshToken(ctx context.Context) error
- func (d *NetDisk) CreateFile(uploadFile *CreateFileParam) (*CreateFile, error)
- func (d *NetDisk) GetAccessToken(code, registeredUrl string) (*TokenResponse, error)
- func (d *NetDisk) IsDebug(isDebug bool)
- func (d *NetDisk) PreCreate(uploadFile *PreCreateUploadFileParam) (*PreCreateUploadFile, error)
- func (d *NetDisk) RefreshToken(force bool) error
- func (d *NetDisk) SetAccessToken(token *TokenResponse)
- func (d *NetDisk) UploadFile(uploadFile *PreCreateUploadFile, localFile string) ([]SuperFile, error)
- func (d *NetDisk) UploadFiles(uploadFile *PreCreateUploadFile, reader io.Reader) ([]SuperFile, error)
- func (d *NetDisk) UserInfo() (*UserInfo, error)
- type PreCreateUploadFile
- type PreCreateUploadFileParam
- type SuperFile
- type SuperFileParam
- type TokenResponse
- type UploadFileInfo
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type CreateFile ¶
type CreateFile struct { UploadFileInfo ErrNo int `json:"errno"` ServerFilename string `json:"server_filename"` }
func (*CreateFile) String ¶
func (p *CreateFile) String() string
type CreateFileParam ¶
type CreateFileParam struct { Path string `json:"path"` Size int `json:"size"` IsDir bool `json:"isdir"` RType int `json:"rtype"` UploadId string `json:"uploadid"` BlockList []string `json:"block_list"` LocalCTime int64 `json:"local_ctime"` LocalMTime int64 `json:"local_mtime"` ZipQuality int `json:"zip_quality"` ZipSign string `json:"zip_sign"` IsRevision int `json:"is_revision"` Mode int `json:"mode"` ExifInfo string `json:"exif_info"` }
func NewCreateFileParam ¶
func NewCreateFileParam(path string, size int, isDir bool) *CreateFileParam
func (*CreateFileParam) String ¶
func (p *CreateFileParam) String() string
func (*CreateFileParam) Values ¶
func (p *CreateFileParam) Values() url.Values
type ErrorResponse ¶
type ErrorResponse struct { Error string `json:"error"` ErrorDescription string `json:"error_description"` TokenResponse }
func (*ErrorResponse) String ¶
func (e *ErrorResponse) String() string
type NetDisk ¶ added in v1.0.3
type NetDisk struct {
// contains filtered or unexported fields
}
func NewNetDisk ¶ added in v1.0.3
func (*NetDisk) AuthorizeURI ¶ added in v1.0.3
AuthorizeURI 获取用户授权页面.
func (*NetDisk) AutoRefreshToken ¶ added in v1.0.3
func (*NetDisk) CreateFile ¶ added in v1.0.3
func (d *NetDisk) CreateFile(uploadFile *CreateFileParam) (*CreateFile, error)
func (*NetDisk) GetAccessToken ¶ added in v1.0.3
func (d *NetDisk) GetAccessToken(code, registeredUrl string) (*TokenResponse, error)
GetAccessToken 获取access_token值.
func (*NetDisk) PreCreate ¶ added in v1.0.3
func (d *NetDisk) PreCreate(uploadFile *PreCreateUploadFileParam) (*PreCreateUploadFile, error)
PreCreate 预创建文件.
func (*NetDisk) RefreshToken ¶ added in v1.0.3
RefreshToken 刷新access_token值.
func (*NetDisk) SetAccessToken ¶ added in v1.0.3
func (d *NetDisk) SetAccessToken(token *TokenResponse)
func (*NetDisk) UploadFile ¶ added in v1.0.3
func (d *NetDisk) UploadFile(uploadFile *PreCreateUploadFile, localFile string) ([]SuperFile, error)
UploadFile 上传指定路径的文件.
func (*NetDisk) UploadFiles ¶ added in v1.0.3
func (d *NetDisk) UploadFiles(uploadFile *PreCreateUploadFile, reader io.Reader) ([]SuperFile, error)
UploadFiles 批量上传文件.
type PreCreateUploadFile ¶
type PreCreateUploadFile struct { ErrNo int `json:"errno"` Path string `json:"path"` UploadId string `json:"uploadid"` ReturnType int `json:"return_type"` BlockList []int `json:"block_list"` Info UploadFileInfo `json:"info,omitempty"` }
func (*PreCreateUploadFile) String ¶
func (u *PreCreateUploadFile) String() string
type PreCreateUploadFileParam ¶
type PreCreateUploadFileParam struct { Path string `json:"path"` Size int `json:"size"` IsDir bool `json:"is_dir"` AutoInit int `json:"autoinit"` RType int `json:"rtype"` UploadId string `json:"uploadid"` BlockList []string `json:"block_list"` ContentMD5 string `json:"content_md5"` SliceMD5 string `json:"slice_md5"` LocalCTime int64 `json:"local_ctime"` LocalMTime int64 `json:"local_mtime"` }
func NewPreCreateUploadFileParam ¶
func NewPreCreateUploadFileParam(filename string, path string) (*PreCreateUploadFileParam, error)
func (*PreCreateUploadFileParam) String ¶
func (u *PreCreateUploadFileParam) String() string
func (*PreCreateUploadFileParam) Values ¶
func (u *PreCreateUploadFileParam) Values() url.Values
type SuperFileParam ¶
type SuperFileParam struct { AccessToken string Method string Type string Path string UploadId string PartSeq int }
func (*SuperFileParam) Values ¶
func (s *SuperFileParam) Values() url.Values
type TokenResponse ¶
type TokenResponse struct { AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` RefreshToken string `json:"refresh_token"` Scope string `json:"scope"` SessionKey string `json:"session_key"` SessionSecret string `json:"session_secret"` CreateAt int64 `json:"-"` RefreshTokenCreateAt int64 `json:"-"` }
func (*TokenResponse) Clone ¶
func (t *TokenResponse) Clone() *TokenResponse
func (*TokenResponse) IsExpired ¶
func (t *TokenResponse) IsExpired() bool
func (*TokenResponse) IsRefreshTokenExpired ¶
func (t *TokenResponse) IsRefreshTokenExpired() bool
type UploadFileInfo ¶
type UploadFileInfo struct { Size int `json:"size"` Category int `json:"category"` IsDir int `json:"is_dir"` Path string `json:"path"` FsId int64 `json:"fs_id"` MD5 string `json:"md5"` CTime int64 `json:"ctime"` MTime int64 `json:"mtime"` }
func (UploadFileInfo) String ¶
func (f UploadFileInfo) String() string
Click to show internal directories.
Click to hide internal directories.