Added Bucket routes and bucket logic

This commit is contained in:
2026-02-21 21:27:34 +01:00
parent 151c11a636
commit 6fe5a8a629
5 changed files with 401 additions and 23 deletions

View File

@@ -1,5 +1,10 @@
package models
import (
"encoding/xml"
"time"
)
type ObjectManifest struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
@@ -9,3 +14,38 @@ type ObjectManifest struct {
Chunks []string `json:"chunks"`
CreatedAt int64 `json:"created_at"`
}
type BucketManifest struct {
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
OwnerID string `json:"owner_id"`
OwnerDisplayName string `json:"owner_display_name"`
Region string `json:"region"`
VersioningStatus string `json:"versioning_status"`
PublicAccessBlock bool `json:"public_access_block"`
}
type ListBucketResult struct {
XMLName xml.Name `xml:"ListBucketResult"`
Xmlns string `xml:"xmlns,attr"`
Name string `xml:"Name"`
Prefix string `xml:"Prefix"`
KeyCount int `xml:"KeyCount"`
MaxKeys int `xml:"MaxKeys"`
IsTruncated bool `xml:"IsTruncated"`
Contents []Contents `xml:"Contents"`
CommonPrefixes []CommonPrefixes `xml:"CommonPrefixes,omitempty"`
}
type Contents struct {
Key string `xml:"Key"`
LastModified string `xml:"LastModified"`
ETag string `xml:"ETag"`
Size int64 `xml:"Size"`
StorageClass string `xml:"StorageClass"`
}
type CommonPrefixes struct {
Prefix string `xml:"Prefix"`
}