Documentation
¶
Overview ¶
Package phonefile implements the multi-step file upload used by cloud phones.
The flow mirrors the PMOCK client:
- POST /open/api/phone/minio/init/task -> uploadId + per-part presigned URLs
- PUT each missing part to its presigned URL, collecting ETags
- POST /open/api/phone/completeAndPush -> merge (OBS) and push to the phone
MinIO merges server-side, so mergeList is empty; OBS requires the ETag list.
Index ¶
Constants ¶
const ( // TypeApp marks the upload as an APK/app asset. TypeApp = 1 // TypeFile marks the upload as a temporary file. TypeFile = 2 // MaxFileSize is the documented open API limit. MaxFileSize int64 = 1 << 30 // DefaultChunkSize is the documented minimum chunk size. DefaultChunkSize int64 = 30 << 20 // MaxChunkSize is the documented maximum chunk size. MaxChunkSize int64 = 300 << 20 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
PhoneID int64
FilePath string
UploadType int // TypeApp or TypeFile
DestDir string
ChunkSize int64
MD5 string
}
Options describes one upload.
type Plan ¶
type Plan struct {
FileName string
Size int64
MD5 string
ChunkSize int64
ChunkNum int
UploadType int
PhoneID int64
DestDir string
}
Plan is the local, network-free part of an upload.