droboticflow/internal/domain/object_storage_browser.go
2026-07-28 20:43:46 +08:00

169 lines
6.5 KiB
Go

package domain
type ObjectStorageBucketSummary struct {
Name string `json:"name"`
ObjectCount int64 `json:"objectCount,omitempty"`
TotalBytes int64 `json:"totalBytes,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
LastModified string `json:"lastModified,omitempty"`
}
type ObjectStorageObjectSummary struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
Name string `json:"name"`
Kind string `json:"kind"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
ContentType string `json:"contentType,omitempty"`
ETag string `json:"etag,omitempty"`
VersionID string `json:"versionId,omitempty"`
LastModified string `json:"lastModified,omitempty"`
StorageClass string `json:"storageClass,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
type ObjectStorageOverview struct {
ConnectionID string `json:"connectionId,omitempty"`
ConnectionName string `json:"connectionName,omitempty"`
Provider string `json:"provider"`
Endpoint string `json:"endpoint,omitempty"`
Bucket string `json:"bucket,omitempty"`
Configured bool `json:"configured"`
Buckets []ObjectStorageBucketSummary `json:"buckets"`
}
type ObjectStorageBrowseResult struct {
ConnectionID string `json:"connectionId,omitempty"`
ConnectionName string `json:"connectionName,omitempty"`
Provider string `json:"provider"`
Endpoint string `json:"endpoint,omitempty"`
Configured bool `json:"configured"`
Bucket string `json:"bucket"`
Prefix string `json:"prefix,omitempty"`
Items []ObjectStorageObjectSummary `json:"items"`
NextMarker string `json:"nextMarker,omitempty"`
HasMore bool `json:"hasMore"`
Limit int `json:"limit,omitempty"`
}
type ObjectStorageBucketCreateInput struct {
Name string `json:"name"`
}
type ObjectStorageBucketMutationResult struct {
Bucket ObjectStorageBucketSummary `json:"bucket"`
}
type ObjectStorageBucketDeleteResult struct {
Bucket string `json:"bucket"`
Deleted bool `json:"deleted"`
}
type ObjectStorageObjectPutInput struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
Content string `json:"content"`
ContentType string `json:"contentType,omitempty"`
}
type ObjectStorageObjectRenameInput struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
NewKey string `json:"newKey"`
Recursive bool `json:"recursive,omitempty"`
DestinationPrefix string `json:"destinationPrefix,omitempty"`
Items []ObjectStorageObjectMoveItem `json:"items,omitempty"`
}
type ObjectStorageObjectMoveItem struct {
Key string `json:"key"`
Kind string `json:"kind,omitempty"`
Recursive bool `json:"recursive,omitempty"`
}
type ObjectStorageObjectMutationResult struct {
Object ObjectStorageObjectSummary `json:"object"`
Objects []ObjectStorageObjectSummary `json:"objects,omitempty"`
}
type ObjectStorageObjectDeleteResult struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
Deleted bool `json:"deleted"`
}
type ObjectStoragePresignedUploadResult struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
Method string `json:"method"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
ExpiresAt string `json:"expiresAt"`
}
type ObjectStorageMultipartUploadCreateResult struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
UploadID string `json:"uploadId"`
ExpiresAt string `json:"expiresAt"`
}
type ObjectStorageMultipartUploadPartURLResult struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
UploadID string `json:"uploadId"`
PartNumber int `json:"partNumber"`
Method string `json:"method"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
ExpiresAt string `json:"expiresAt"`
}
type ObjectStorageMultipartUploadPart struct {
PartNumber int `json:"partNumber"`
ETag string `json:"eTag"`
}
type ObjectStorageMultipartUploadAbortResult struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
UploadID string `json:"uploadId"`
Aborted bool `json:"aborted"`
}
type ObjectStorageBatchUploadItemInput struct {
RelativePath string `json:"relativePath"`
Kind string `json:"kind"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
ContentType string `json:"contentType,omitempty"`
}
type ObjectStorageBatchUploadPrepareInput struct {
Bucket string `json:"bucket"`
Prefix string `json:"prefix,omitempty"`
ConflictPolicy string `json:"conflictPolicy,omitempty"`
Items []ObjectStorageBatchUploadItemInput `json:"items"`
}
type ObjectStorageBatchUploadPreparedItem struct {
RelativePath string `json:"relativePath"`
Key string `json:"key"`
Kind string `json:"kind"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
ContentType string `json:"contentType,omitempty"`
Action string `json:"action"`
Exists bool `json:"exists"`
Message string `json:"message,omitempty"`
}
type ObjectStorageBatchUploadPrepareResult struct {
Bucket string `json:"bucket"`
Prefix string `json:"prefix,omitempty"`
ConflictPolicy string `json:"conflictPolicy"`
Items []ObjectStorageBatchUploadPreparedItem `json:"items"`
UploadCount int `json:"uploadCount"`
PlaceholderCount int `json:"placeholderCount"`
SkipCount int `json:"skipCount"`
ConflictCount int `json:"conflictCount"`
}