Documentation
¶
Overview ¶
Package upload defines the chunked upload-session wire types shared by the backend, frontend contract, and CLI.
Index ¶
Constants ¶
View Source
const ( KindImage = "image" KindVolumeBackup = "volume-backup" KindBuildWorkspace = "build-workspace" )
Session kinds tie an upload session to the domain endpoint allowed to consume it.
View Source
const ( DefaultChunkSize int64 = 10 * 1024 * 1024 MinChunkSize int64 = 1 * 1024 * 1024 MaxChunkSize int64 = 50 * 1024 * 1024 )
Chunk size bounds keep every chunk request safely under common reverse-proxy and WAF body limits (~100 MB).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumeRequest ¶
type ConsumeRequest struct {
UploadID string `json:"uploadId" required:"true" doc:"ID of a complete upload session"`
}
ConsumeRequest references a complete upload session from a domain endpoint.
type CreateSessionRequest ¶
type CreateSessionRequest struct {
Filename string `json:"filename" required:"true" doc:"Original filename; validated per kind"`
Size int64 `json:"size" required:"true" minimum:"1" doc:"Total file size in bytes"`
ChunkSize int64 `json:"chunkSize,omitempty" doc:"Chunk size in bytes; server default and bounds apply"`
}
CreateSessionRequest starts a chunked upload session.
type Session ¶
type Session struct {
CreatedAt time.Time `json:"createdAt"`
ID string `json:"id"`
Kind string `json:"kind"`
Filename string `json:"filename"`
ReceivedChunks []int `json:"receivedChunks"`
Size int64 `json:"size"`
ChunkSize int64 `json:"chunkSize"`
TotalChunks int `json:"totalChunks"`
Complete bool `json:"complete"`
}
Session describes a chunked upload session, including which chunks have been received so clients can resume by re-sending only the missing ones.
Click to show internal directories.
Click to hide internal directories.