Documentation
¶
Index ¶
- Constants
- func SignURL(originURL, privateKey string, uid uint64, validDuration time.Duration) (string, error)
- type Addition
- type DirectLinkData
- type DirectLinkResp
- type File
- func (f File) CreateTime() time.Time
- func (f File) GetHash() utils.HashInfo
- func (f File) GetID() string
- func (f File) GetModified() string
- func (f File) GetName() string
- func (f File) GetPath() string
- func (f File) GetSize() int64
- func (f File) GetThumb() string
- func (f File) IsDir() bool
- func (f File) ModTime() time.Time
- type FileListData
- type FileListResp
- type MakeDirData
- type MakeDirRequest
- type MakeDirResp
- type Open123
- func (d *Open123) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, ...) ([]model.Obj, error)
- func (d *Open123) Config() driver.Config
- func (d *Open123) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *Open123) Drop(ctx context.Context) error
- func (d *Open123) Extract(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (*model.Link, error)
- func (d *Open123) GetAddition() driver.Additional
- func (d *Open123) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error)
- func (d *Open123) GetUploadDomains() ([]string, error)
- func (d *Open123) Init(ctx context.Context) error
- func (d *Open123) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *Open123) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *Open123) ListArchive(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) ([]model.Obj, error)
- func (d *Open123) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)
- func (d *Open123) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *Open123) Put(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) error
- func (d *Open123) Remove(ctx context.Context, obj model.Obj) error
- func (d *Open123) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
- func (d *Open123) Request(endpoint string, method string, setup func(*resty.Request), result any) (*resty.Response, error)
- func (d *Open123) RequestTo(fullURL string, method string, setup func(*resty.Request), result any) (*resty.Response, error)
- func (d *Open123) Upload(ctx context.Context, file model.FileStreamer, parentID int64, ...) error
- func (d *Open123) UploadSingle(ctx context.Context, createResp *UploadCreateResp, file model.FileStreamer, ...) error
- type RemoveRequest
- type Response
- type TokenData
- type TokenResp
- type UploadCompleteData
- type UploadCompleteResp
- type UploadCreateData
- type UploadCreateResp
- type UploadUrlData
- type UploadUrlResp
Constants ¶
View Source
const ( // baseurl ApiBaseURL = "https://open-api.123pan.com" // auth ApiToken = "/api/v1/access_token" // file list ApiFileList = "/api/v2/file/list" // direct link ApiGetDirectLink = "/api/v1/direct-link/url" // mkdir ApiMakeDir = "/upload/v1/file/mkdir" // remove ApiRemove = "/api/v1/file/trash" // upload ApiUploadDomainURL = "/upload/v2/file/domain" ApiSingleUploadURL = "/upload/v2/file/single/create" ApiCreateUploadURL = "/upload/v2/file/create" ApiUploadSliceURL = "/upload/v2/file/slice" ApiUploadCompleteURL = "/upload/v2/file/upload_complete" // move ApiMove = "/api/v1/file/move" // rename ApiRename = "/api/v1/file/name" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Addition ¶
type Addition struct {
driver.RootID
ClientID string `json:"client_id" required:"true" label:"Client ID"`
ClientSecret string `json:"client_secret" required:"true" label:"Client Secret"`
PrivateKey string `json:"private_key"`
UID uint64 `json:"uid" type:"number"`
ValidDuration int64 `json:"valid_duration" type:"number" default:"30" help:"minutes"`
}
type DirectLinkData ¶
type DirectLinkData struct {
URL string `json:"url"`
}
type DirectLinkResp ¶
type DirectLinkResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data DirectLinkData `json:"data"`
}
type File ¶
type File struct {
FileName string `json:"filename"`
Size int64 `json:"size"`
CreateAt string `json:"createAt"`
UpdateAt string `json:"updateAt"`
FileId int64 `json:"fileId"`
Type int `json:"type"`
Etag string `json:"etag"`
S3KeyFlag string `json:"s3KeyFlag"`
ParentFileId int `json:"parentFileId"`
Category int `json:"category"`
Status int `json:"status"`
Trashed int `json:"trashed"`
}
func (File) CreateTime ¶
func (File) GetModified ¶
type FileListData ¶
type FileListResp ¶
type FileListResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data FileListData `json:"data"`
}
type MakeDirData ¶
type MakeDirData struct {
DirID int64 `json:"dirID"`
}
type MakeDirRequest ¶
type MakeDirResp ¶
type MakeDirResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data MakeDirData `json:"data"`
}
type Open123 ¶
type Open123 struct {
model.Storage
Addition
UploadThread int
// contains filtered or unexported fields
}
func (*Open123) ArchiveDecompress ¶
func (*Open123) GetAddition ¶
func (d *Open123) GetAddition() driver.Additional
func (*Open123) GetArchiveMeta ¶
func (d *Open123) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error)
func (*Open123) GetUploadDomains ¶
func (*Open123) ListArchive ¶
func (*Open123) Put ¶
func (d *Open123) Put(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) error
func (*Open123) Upload ¶
func (d *Open123) Upload(ctx context.Context, file model.FileStreamer, parentID int64, createResp *UploadCreateResp, up driver.UpdateProgress) error
func (*Open123) UploadSingle ¶
func (d *Open123) UploadSingle(ctx context.Context, createResp *UploadCreateResp, file model.FileStreamer, parentID int64) error
type RemoveRequest ¶
type RemoveRequest struct {
FileIDs []int64 `json:"fileIDs"`
}
type UploadCompleteData ¶
type UploadCompleteResp ¶
type UploadCompleteResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data UploadCompleteData `json:"data"`
}
type UploadCreateData ¶
type UploadCreateResp ¶
type UploadCreateResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data UploadCreateData `json:"data"`
}
type UploadUrlData ¶
type UploadUrlData struct {
PresignedURL string `json:"presignedUrl"`
}
type UploadUrlResp ¶
type UploadUrlResp struct {
Code int `json:"code"`
Message string `json:"message"`
Data UploadUrlData `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.