42 lines
867 B
Go
42 lines
867 B
Go
package depot
|
|
|
|
import "time"
|
|
|
|
type Object struct {
|
|
ID string
|
|
Name string
|
|
ContentType string
|
|
ContentLength int64
|
|
BucketName string
|
|
ObjectKey string
|
|
ContainsContent bool
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type PrepareUploadInput struct {
|
|
Prefix string // optional, e.g. network_id
|
|
Name string
|
|
ContentType string
|
|
ContentLength int64
|
|
}
|
|
|
|
type PrepareUploadResult struct {
|
|
ObjectID string
|
|
UploadURL string
|
|
UploadHeaders map[string]string
|
|
}
|
|
|
|
// For server-side direct uploads (no presigned URL).
|
|
type CreateFromReaderInput struct {
|
|
Prefix string // optional, e.g. network_id
|
|
Name string
|
|
ContentType string
|
|
}
|
|
|
|
type Config struct {
|
|
GoogleServiceAccountEmail string
|
|
BucketName string
|
|
UploadURLExpiry time.Duration
|
|
DownloadURLExpiry time.Duration
|
|
}
|