spark-server/internal/module/upload/entity/credential.go
2026-09-18 18:27:49 +08:00

28 lines
842 B
Go

// Package entity holds upload credential types. Message content stores the object key only.
package entity
type Credential struct {
ObjectKey string `json:"object_key"`
UploadURL string `json:"upload_url"`
Method string `json:"method"`
Headers map[string]string `json:"headers"`
ExpiresIn int64 `json:"expires_in"`
}
// CredentialSet is one HTTP round-trip for up to three PUTs (thumb / preview / orig).
type CredentialSet struct {
Items []Credential `json:"items"`
}
type Download struct {
ObjectKey string `json:"object_key"`
DownloadURL string `json:"download_url"`
Method string `json:"method"`
ExpiresIn int64 `json:"expires_in"`
}
// DownloadSet is one HTTP round-trip for up to nine Presigned GETs.
type DownloadSet struct {
Items []Download `json:"items"`
}