s3types

package
v0.0.0-...-61396ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllUsersGroup           = "http://acs.amazonaws.com/groups/global/AllUsers"
	AuthenticatedUsersGroup = "http://acs.amazonaws.com/groups/global/AuthenticatedUsers"
	LogDeliveryGroup        = "http://acs.amazonaws.com/groups/s3/LogDelivery"
)

Predefined ACL group URIs

View Source
const (
	AccessTierArchive     = "ARCHIVE_ACCESS"
	AccessTierDeepArchive = "DEEP_ARCHIVE_ACCESS"
)

IntelligentTieringAccessTier constants

View Source
const (
	IntelligentTieringEnabled  = "Enabled"
	IntelligentTieringDisabled = "Disabled"
)

IntelligentTieringStatus constants

View Source
const (
	ObjectOwnershipBucketOwnerPreferred = "BucketOwnerPreferred"
	ObjectOwnershipObjectWriter         = "ObjectWriter"
	ObjectOwnershipBucketOwnerEnforced  = "BucketOwnerEnforced"
)

ObjectOwnership values

View Source
const (
	PayerBucketOwner = "BucketOwner"
	PayerRequester   = "Requester"
)

Payer values

Variables

This section is empty.

Functions

This section is empty.

Types

type AccelerateConfiguration

type AccelerateConfiguration struct {
	XMLName xml.Name `xml:"AccelerateConfiguration" json:"-"`
	Status  string   `xml:"Status" json:"status"` // Enabled or Suspended
}

AccelerateConfiguration defines transfer acceleration.

type AccessControlList

type AccessControlList struct {
	Owner  Owner   `xml:"Owner" json:"owner"`
	Grants []Grant `xml:"AccessControlList>Grant" json:"grants"`
}

AccessControlList represents an S3 Access Control List (internal representation)

func FromCannedACL

func FromCannedACL(canned CannedACL, ownerID, ownerDisplayName string) *AccessControlList

FromCannedACL creates an AccessControlList from a canned ACL

func NewPrivateACL

func NewPrivateACL(ownerID, ownerDisplayName string) *AccessControlList

NewPrivateACL creates a private ACL owned by the given account

func (*AccessControlList) CheckAccess

func (acl *AccessControlList) CheckAccess(accountID string, isAuthenticated bool, required Permission) bool

CheckAccess checks if the given account ID has the required permission

func (*AccessControlList) ToAccessControlPolicy

func (acl *AccessControlList) ToAccessControlPolicy() *AccessControlPolicy

ToAccessControlPolicy converts an AccessControlList to the XML response format

type AccessControlListXML

type AccessControlListXML struct {
	Grants []GrantXML `xml:"Grant"`
}

AccessControlListXML is the XML wrapper for grants in AccessControlPolicy

type AccessControlPolicy

type AccessControlPolicy struct {
	XMLName           xml.Name             `xml:"AccessControlPolicy"`
	Xmlns             string               `xml:"xmlns,attr,omitempty"`
	Owner             Owner                `xml:"Owner"`
	AccessControlList AccessControlListXML `xml:"AccessControlList"`
}

AccessControlPolicy is the XML format for ACL API responses This is the top-level wrapper for GetBucketAcl/GetObjectAcl responses

type AccessControlTranslation

type AccessControlTranslation struct {
	Owner string `xml:"Owner"` // "Destination"
}

AccessControlTranslation controls ownership translation.

type Action

type Action int

Action represents what action should be taken on an object

const (
	// NoneAction - no action required
	NoneAction Action = iota
	// DeleteAction - delete the object
	DeleteAction
	// DeleteVersionAction - delete a specific version
	DeleteVersionAction
	// DeleteAllVersionsAction - delete all versions of an object
	DeleteAllVersionsAction
	// TransitionAction - transition object to another storage class
	TransitionAction
	// TransitionVersionAction - transition a specific version
	TransitionVersionAction
	// AbortMultipartUploadAction - abort incomplete multipart upload
	AbortMultipartUploadAction
)

func (Action) String

func (a Action) String() string

String returns string representation of action

type Bucket

type Bucket struct {
	ID         uuid.UUID
	Name       string
	OwnerID    string
	CreateTime time.Time
	Versioning Versioning
	BucketMode BucketMode

	// Location/region constraint
	Location string

	// Core configurations
	LifecyclePolicy   *Lifecycle
	Logging           *BucketLoggingStatus
	Policy            *BucketPolicy
	ACL               *AccessControlList
	ReplicationConfig *ReplicationConfiguration // Enterprise: cross-region replication

	// Additional S3 configurations
	CORS               *CORSConfiguration          // Cross-origin resource sharing
	Tagging            *TagSet                     // Bucket tags
	Encryption         *ServerSideEncryptionConfig // Default encryption
	Website            *WebsiteConfiguration       // Static website hosting
	ObjectLockConfig   *ObjectLockConfiguration    // WORM compliance
	NotificationConfig *NotificationConfiguration  // Event notifications
	Accelerate         *AccelerateConfiguration    // Transfer acceleration
	RequestPayment     *RequestPaymentConfig       // Requester pays
	OwnershipControls  *OwnershipControls          // Object ownership
	PublicAccessBlock  *PublicAccessBlockConfig    // Block public access
}

Bucket represents an S3 bucket with all its configuration.

type BucketInfo

type BucketInfo struct {
	Name         string `xml:"Name"`
	CreationDate string `xml:"CreationDate"`           // ISO 8601 format
	Region       string `xml:"BucketRegion,omitempty"` // Region (included in paginated responses)
}

BucketInfo represents a bucket in list responses

type BucketList

type BucketList struct {
	Buckets []BucketInfo `xml:"Bucket"`
}

BucketList is a list of buckets

type BucketLoggingStatus

type BucketLoggingStatus struct {
	XMLName        xml.Name    `xml:"BucketLoggingStatus"`
	LoggingEnabled LoggingRule `xml:"LoggingEnabled"`
}

type BucketMode

type BucketMode uint64
const (
	BucketModeNone BucketMode = iota
	BucketModeMigrating
	BucketModeAdminLocked
	BucketModeAsyncDelete
	BucketModeReadOnly
	BucketModePassthrough // Proxy requests to external S3, metadata stored locally (federation)
)

func ParseBucketMode

func ParseBucketMode(s string) BucketMode

ParseBucketMode parses a string into a BucketMode

func (BucketMode) IsFederated

func (m BucketMode) IsFederated() bool

IsFederated returns true if the bucket is federated (passthrough or migrating)

func (BucketMode) String

func (m BucketMode) String() string

String returns the string representation of the bucket mode

type BucketOwner

type BucketOwner struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

BucketOwner represents owner info in bucket responses

type BucketPolicy

type BucketPolicy struct {
	Version    string      `json:"Version"`
	ID         string      `json:"Id,omitempty"`
	Statements []Statement `json:"Statement"`
}

BucketPolicy represents an S3 bucket policy document

func (*BucketPolicy) Evaluate

func (bp *BucketPolicy) Evaluate(action S3Action, ctx *PolicyEvaluationContext) Effect

Evaluate checks if the policy allows the given action. Returns the effect and whether a statement explicitly matched.

func (*BucketPolicy) EvaluateWithResult

func (bp *BucketPolicy) EvaluateWithResult(action S3Action, ctx *PolicyEvaluationContext) EvaluationResult

EvaluateWithResult checks if the policy allows the given action and returns detailed information about the match. Use this when you need to distinguish between explicit deny and no-match (implicit deny).

type CORSConfiguration

type CORSConfiguration struct {
	XMLName xml.Name   `xml:"CORSConfiguration" json:"-"`
	Rules   []CORSRule `xml:"CORSRule" json:"cors_rules"`
}

CORSConfiguration defines cross-origin resource sharing rules.

type CORSRule

type CORSRule struct {
	ID             string   `xml:"ID,omitempty" json:"id,omitempty"`
	AllowedHeaders []string `xml:"AllowedHeader" json:"allowed_headers,omitempty"`
	AllowedMethods []string `xml:"AllowedMethod" json:"allowed_methods"`
	AllowedOrigins []string `xml:"AllowedOrigin" json:"allowed_origins"`
	ExposeHeaders  []string `xml:"ExposeHeader,omitempty" json:"expose_headers,omitempty"`
	MaxAgeSeconds  int      `xml:"MaxAgeSeconds,omitempty" json:"max_age_seconds,omitempty"`
}

CORSRule defines a single CORS rule.

type CannedACL

type CannedACL string

Canned ACL types

const (
	ACLPrivate           CannedACL = "private"
	ACLPublicRead        CannedACL = "public-read"
	ACLPublicReadWrite   CannedACL = "public-read-write"
	ACLAuthenticatedRead CannedACL = "authenticated-read"
	ACLBucketOwnerRead   CannedACL = "bucket-owner-read"
	ACLBucketOwnerFull   CannedACL = "bucket-owner-full-control"
	ACLLogDeliveryWrite  CannedACL = "log-delivery-write"
	ACLAwsExecRead       CannedACL = "aws-exec-read"
)

func ParseValidCannedACL

func ParseValidCannedACL(input string) (CannedACL, error)

func (CannedACL) String

func (ca CannedACL) String() string

type ChecksumAlgorithm

type ChecksumAlgorithm uint8
const (
	ChecksumAlgorithmNone ChecksumAlgorithm = iota
	ChecksumAlgorithmCRC32
	ChecksumAlgorithmCRC32C
	ChecksumAlgorithmCRC64NVMe
	ChecksumAlgorithmSHA1
	ChecksumAlgorithmSHA256
)

func ParseChecksumAlgorithm

func ParseChecksumAlgorithm(s string) (ChecksumAlgorithm, error)

func (ChecksumAlgorithm) IsValid

func (c ChecksumAlgorithm) IsValid() bool

func (ChecksumAlgorithm) String

func (c ChecksumAlgorithm) String() string

type CommonPrefix

type CommonPrefix struct {
	Prefix string `xml:"Prefix"`
}

CommonPrefix represents a common prefix in list responses (for delimiter) Note: Also used by multipart uploads list

type CompleteMultipartUploadRequest

type CompleteMultipartUploadRequest struct {
	XMLName xml.Name       `xml:"CompleteMultipartUpload"`
	Parts   []CompletePart `xml:"Part"`
}

CompleteMultipartUploadRequest is the request body for CompleteMultipartUpload

type CompleteMultipartUploadResult

type CompleteMultipartUploadResult struct {
	XMLName  xml.Name `xml:"CompleteMultipartUploadResult"`
	Xmlns    string   `xml:"xmlns,attr,omitempty"`
	Location string   `xml:"Location"`
	Bucket   string   `xml:"Bucket"`
	Key      string   `xml:"Key"`
	ETag     string   `xml:"ETag"`
}

CompleteMultipartUploadResult is the response for CompleteMultipartUpload

type CompletePart

type CompletePart struct {
	PartNumber int    `xml:"PartNumber"`
	ETag       string `xml:"ETag"`
}

CompletePart represents a part in the complete request

type Condition

type Condition map[string][]string

Condition represents conditional access rules Key is the condition operator (IpAddress, StringEquals, etc.)

type CopyObjectResult

type CopyObjectResult struct {
	ETag         string    `xml:"ETag"`
	LastModified time.Time `xml:"LastModified"`
}

CopyObjectResult is the XML response body for CopyObject operations.

func (*CopyObjectResult) ToXML

func (r *CopyObjectResult) ToXML() ([]byte, error)

ToXML serializes CopyObjectResult to XML with the proper namespace.

type DefaultRetention

type DefaultRetention struct {
	Mode  string `xml:"Mode" json:"mode"` // GOVERNANCE or COMPLIANCE
	Days  int    `xml:"Days,omitempty" json:"days,omitempty"`
	Years int    `xml:"Years,omitempty" json:"years,omitempty"`
}

DefaultRetention defines default retention period.

type DeleteError

type DeleteError struct {
	Key       string `xml:"Key"`
	VersionID string `xml:"VersionId,omitempty"`
	Code      string `xml:"Code"`
	Message   string `xml:"Message"`
}

DeleteError represents a deletion error

type DeleteMarker

type DeleteMarker struct {
	Key          string `xml:"Key"`
	VersionID    string `xml:"VersionId"`
	IsLatest     bool   `xml:"IsLatest"`
	LastModified string `xml:"LastModified"`
	Owner        *Owner `xml:"Owner,omitempty"`
}

DeleteMarker represents a delete marker version

type DeleteMarkerReplication

type DeleteMarkerReplication struct {
	Status string `xml:"Status"` // "Enabled" or "Disabled"
}

DeleteMarkerReplication controls delete marker replication.

type DeleteObjectEntry

type DeleteObjectEntry struct {
	Key       string `xml:"Key"`
	VersionID string `xml:"VersionId,omitempty"`
}

DeleteObjectEntry represents an object to delete

type DeleteObjectsRequest

type DeleteObjectsRequest struct {
	XMLName xml.Name            `xml:"Delete"`
	Quiet   bool                `xml:"Quiet"`
	Objects []DeleteObjectEntry `xml:"Object"`
}

DeleteObjectsRequest is the XML request for DeleteObjects (multi-object delete)

type DeleteObjectsResult

type DeleteObjectsResult struct {
	XMLName xml.Name        `xml:"DeleteResult"`
	Xmlns   string          `xml:"xmlns,attr"`
	Deleted []DeletedObject `xml:"Deleted"`
	Error   []DeleteError   `xml:"Error,omitempty"`
}

DeleteObjectsResult is the XML response for DeleteObjects

type DeletedObject

type DeletedObject struct {
	Key                   string `xml:"Key"`
	VersionID             string `xml:"VersionId,omitempty"`
	DeleteMarker          bool   `xml:"DeleteMarker,omitempty"`
	DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId,omitempty"`
}

DeletedObject represents a successfully deleted object

type Effect

type Effect string

Effect determines whether a statement allows or denies access

const (
	EffectAllow Effect = "Allow"
	EffectDeny  Effect = "Deny"
)

type EncryptionByDefault

type EncryptionByDefault struct {
	SSEAlgorithm   string `xml:"SSEAlgorithm" json:"sse_algorithm"` // AES256 or aws:kms
	KMSMasterKeyID string `xml:"KMSMasterKeyID,omitempty" json:"kms_key_id,omitempty"`
}

EncryptionByDefault specifies the default encryption settings.

type EncryptionConfiguration

type EncryptionConfiguration struct {
	ReplicaKmsKeyID string `xml:"ReplicaKmsKeyID,omitempty"`
}

EncryptionConfiguration specifies encryption for replicated objects.

type ErrorDocument

type ErrorDocument struct {
	Key string `xml:"Key" json:"key"`
}

ErrorDocument specifies the error document for website.

type EvaluationResult

type EvaluationResult struct {
	Effect       Effect
	Matched      bool // True if any statement matched (explicit allow/deny)
	ExplicitDeny bool // True if there was an explicit Deny statement
}

EvaluationResult represents the outcome of policy evaluation

type Evaluator

type Evaluator struct {
	// contains filtered or unexported fields
}

Evaluator evaluates lifecycle rules against objects

func NewEvaluator

func NewEvaluator(lc *Lifecycle) *Evaluator

NewEvaluator creates a new lifecycle evaluator

func (*Evaluator) Eval

func (e *Evaluator) Eval(obj ObjectState, now time.Time) Event

Eval evaluates all enabled rules against the given object Returns the highest priority action that should be taken

type Event

type Event struct {
	// Action to take
	Action Action
	// Rule ID that triggered this action
	RuleID string
	// When this action should occur
	Due time.Time
	// Target storage class (for transitions)
	StorageClass string
	// Object this applies to
	Object ObjectState
}

Event represents a lifecycle event that should be executed

type ExistingObjectReplication

type ExistingObjectReplication struct {
	Status string `xml:"Status"` // "Enabled" or "Disabled"
}

ExistingObjectReplication controls replication of existing objects.

type FederationConfig

type FederationConfig struct {
	// Bucket is the local bucket name (primary key)
	Bucket string `json:"bucket"`

	// External S3 connection details
	Endpoint        string `json:"endpoint"`          // e.g., "s3.amazonaws.com"
	Region          string `json:"region"`            // e.g., "us-east-1"
	AccessKeyID     string `json:"access_key_id"`     // External S3 credentials
	SecretAccessKey string `json:"secret_access_key"` // Encrypted at rest
	ExternalBucket  string `json:"external_bucket"`   // Bucket name on external S3
	PathStyle       bool   `json:"path_style"`        // Use path-style addressing

	// Migration tracking
	MigrationStartedAt int64  `json:"migration_started_at,omitempty"` // Unix timestamp
	MigrationPaused    bool   `json:"migration_paused,omitempty"`     // Is migration paused
	ObjectsDiscovered  int64  `json:"objects_discovered,omitempty"`   // Total objects found
	ObjectsSynced      int64  `json:"objects_synced,omitempty"`       // Objects with local chunks
	BytesSynced        int64  `json:"bytes_synced,omitempty"`         // Total bytes synced
	LastSyncKey        string `json:"last_sync_key,omitempty"`        // Resume point for discovery
	DualWriteEnabled   bool   `json:"dual_write_enabled,omitempty"`   // Write to both local and external

	// Timestamps
	CreatedAt int64 `json:"created_at"`
	UpdatedAt int64 `json:"updated_at"`
}

FederationConfig stores the external S3 connection details for a federated bucket. This is stored per-bucket in the metadata database.

func (*FederationConfig) IsComplete

func (c *FederationConfig) IsComplete() bool

IsComplete returns true if all discovered objects have been synced

func (*FederationConfig) ProgressPercent

func (c *FederationConfig) ProgressPercent() float64

ProgressPercent returns the migration progress as a percentage (0-100)

type GetObjectAttributesResponse

type GetObjectAttributesResponse struct {
	XMLName      xml.Name                  `xml:"GetObjectAttributesResponse"`
	Xmlns        string                    `xml:"xmlns,attr,omitempty"`
	ETag         string                    `xml:"ETag,omitempty"`
	Checksum     *ObjectAttributesChecksum `xml:"Checksum,omitempty"`
	ObjectParts  *ObjectAttributesParts    `xml:"ObjectParts,omitempty"`
	StorageClass string                    `xml:"StorageClass,omitempty"`
	ObjectSize   *int64                    `xml:"ObjectSize,omitempty"`
	LastModified string                    `xml:"LastModified,omitempty"`
}

GetObjectAttributesResponse is the XML response for GetObjectAttributes API See: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html

type Grant

type Grant struct {
	Grantee    Grantee    `xml:"Grantee" json:"grantee"`
	Permission Permission `xml:"Permission" json:"permission"`
}

Grant represents a single permission grant to a grantee

type GrantXML

type GrantXML struct {
	Grantee    GranteeXML `xml:"Grantee"`
	Permission Permission `xml:"Permission"`
}

GrantXML represents a grant in XML format with proper namespace attributes

type Grantee

type Grantee struct {
	Type         GranteeType `xml:"type,attr" json:"type"`
	ID           string      `xml:"ID,omitempty" json:"id,omitempty"`
	DisplayName  string      `xml:"DisplayName,omitempty" json:"display_name,omitempty"`
	EmailAddress string      `xml:"EmailAddress,omitempty" json:"email_address,omitempty"`
	URI          string      `xml:"URI,omitempty" json:"uri,omitempty"`
}

Grantee identifies who receives the permission

type GranteeType

type GranteeType string

GranteeType identifies how a grantee is specified

const (
	GranteeTypeCanonicalUser GranteeType = "CanonicalUser"
	GranteeTypeGroup         GranteeType = "Group"
	GranteeTypeEmail         GranteeType = "AmazonCustomerByEmail"
)

type GranteeXML

type GranteeXML struct {
	XMLName     xml.Name `xml:"Grantee"`
	Xmlns       string   `xml:"xmlns:xsi,attr,omitempty"`
	XsiType     string   `xml:"xsi:type,attr,omitempty"`
	ID          string   `xml:"ID,omitempty"`
	DisplayName string   `xml:"DisplayName,omitempty"`
	URI         string   `xml:"URI,omitempty"`
}

GranteeXML represents a grantee in XML format with xsi:type attribute

type IndexDocument

type IndexDocument struct {
	Suffix string `xml:"Suffix" json:"suffix"`
}

IndexDocument specifies the index document for website.

type InitiateMultipartUploadResult

type InitiateMultipartUploadResult struct {
	XMLName  xml.Name `xml:"InitiateMultipartUploadResult"`
	Xmlns    string   `xml:"xmlns,attr,omitempty"`
	Bucket   string   `xml:"Bucket"`
	Key      string   `xml:"Key"`
	UploadID string   `xml:"UploadId"`
}

InitiateMultipartUploadResult is the response for CreateMultipartUpload

type Initiator

type Initiator struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

Initiator represents the initiator of an upload

type IntelligentTieringAndOperator

type IntelligentTieringAndOperator struct {
	Prefix string `xml:"Prefix,omitempty"`
	Tags   []Tag  `xml:"Tag,omitempty"`
}

IntelligentTieringAndOperator combines filter conditions.

type IntelligentTieringConfiguration

type IntelligentTieringConfiguration struct {
	XMLName xml.Name `xml:"IntelligentTieringConfiguration"`

	// ID is the unique identifier for the configuration.
	ID string `xml:"Id"`

	// Filter limits the scope of the configuration to objects matching the filter.
	Filter *IntelligentTieringFilter `xml:"Filter,omitempty"`

	// Status indicates whether the configuration is enabled.
	Status string `xml:"Status"` // "Enabled" or "Disabled"

	// Tierings specifies the access tier transitions.
	Tierings []Tiering `xml:"Tiering"`
}

IntelligentTieringConfiguration represents an S3 Intelligent-Tiering configuration. See: https://docs.aws.amazon.com/AmazonS3/latest/API/API_IntelligentTieringConfiguration.html

func (*IntelligentTieringConfiguration) Validate

func (c *IntelligentTieringConfiguration) Validate() error

Validate validates the intelligent tiering configuration.

type IntelligentTieringFilter

type IntelligentTieringFilter struct {
	// Prefix limits to objects with this prefix.
	Prefix string `xml:"Prefix,omitempty"`

	// Tag limits to objects with this tag.
	Tag *Tag `xml:"Tag,omitempty"`

	// And combines multiple filter conditions.
	And *IntelligentTieringAndOperator `xml:"And,omitempty"`
}

IntelligentTieringFilter specifies which objects to include.

type LambdaFunctionConfiguration

type LambdaFunctionConfiguration struct {
	ID                string              `xml:"Id,omitempty" json:"id,omitempty"`
	LambdaFunctionArn string              `xml:"CloudFunction" json:"lambda_arn"`
	Events            []string            `xml:"Event" json:"events"`
	Filter            *NotificationFilter `xml:"Filter,omitempty" json:"filter,omitempty"`
}

LambdaFunctionConfiguration defines Lambda notification.

type Lifecycle

type Lifecycle struct {
	XMLName xml.Name        `xml:"LifecycleConfiguration"`
	Rules   []LifecycleRule `xml:"Rule"`
}

func (*Lifecycle) HasActiveRules

func (lc *Lifecycle) HasActiveRules(prefix string) bool

HasActiveRules checks if lifecycle has any active rules that could affect the given prefix

func (*Lifecycle) Validate

func (lc *Lifecycle) Validate() error

Validate validates the lifecycle configuration

type LifecycleAbortIncompleteMultipartUpload

type LifecycleAbortIncompleteMultipartUpload struct {
	XMLName             xml.Name `xml:"AbortIncompleteMultipartUpload"`
	DaysAfterInitiation *int64   `xml:"DaysAfterInitiation,omitempty"`
}

func (*LifecycleAbortIncompleteMultipartUpload) Validate

Validate validates abort incomplete multipart upload

type LifecycleExpiration

type LifecycleExpiration struct {
	XMLName                   xml.Name   `xml:"LifecycleExpiration"`
	Date                      *time.Time `xml:"Date,omitempty"`
	Days                      *int64     `xml:"Days,omitempty"`
	ExpiredObjectDeleteMarker *bool      `xml:"ExpiredObjectDeleteMarker,omitempty"`
}

func (*LifecycleExpiration) Validate

func (e *LifecycleExpiration) Validate() error

Validate validates expiration settings

type LifecycleFilter

type LifecycleFilter struct {
	XMLName               xml.Name                  `xml:"Filter"`
	And                   *LifecycleRuleAndOperator `xml:"And,omitempty"`
	ObjectSizeGreaterThan *int64                    `xml:"ObjectSizeGreaterThan,omitempty"`
	ObjectSizeLessThan    *int64                    `xml:"ObjectSizeLessThan,omitempty"`
	Prefix                *string                   `xml:"Prefix,omitempty"`
	Tag                   *Tag                      `xml:"Tag,omitempty"`
}

func (*LifecycleFilter) Validate

func (f *LifecycleFilter) Validate() error

Validate validates the filter

type LifecycleNoncurrentVersionExpiration

type LifecycleNoncurrentVersionExpiration struct {
	XMLName                 xml.Name `xml:"NoncurrentVersionExpiration"`
	NewerNoncurrentVersions *int64   `xml:"NewerNoncurrentVersions,omitempty"`
	Days                    *int64   `xml:"Days,omitempty"`
}

func (*LifecycleNoncurrentVersionExpiration) Validate

Validate validates noncurrent version expiration

type LifecycleNoncurrentVersionTransition

type LifecycleNoncurrentVersionTransition struct {
	XMLName                 xml.Name `xml:"NoncurrentVersionTransition"`
	NewerNoncurrentVersions *int64   `xml:"NewerNoncurrentVersions,omitempty"`
	Days                    *int64   `xml:"Days,omitempty"`
	StorageClass            *string  `xml:"StorageClass,omitempty"`
}

func (*LifecycleNoncurrentVersionTransition) Validate

Validate validates noncurrent version transition

type LifecycleRule

type LifecycleRule struct {
	XMLName                        xml.Name                                 `xml:"Rule"`
	ID                             *string                                  `xml:"ID,omitempty"`
	Status                         LifecycleStatus                          `xml:"Status"`
	AbortIncompleteMultipartUpload *LifecycleAbortIncompleteMultipartUpload `xml:"AbortIncompleteMultipartUpload,omitempty"`
	Expiration                     *LifecycleExpiration                     `xml:"LifecycleExpiration,omitempty"`
	Filter                         *LifecycleFilter                         `xml:"Filter,omitempty"`
	NoncurrentVersionExpiration    *LifecycleNoncurrentVersionExpiration    `xml:"NoncurrentVersionExpiration,omitempty"`
	NoncurrentVersionTransition    *LifecycleNoncurrentVersionTransition    `xml:"NoncurrentVersionTransition,omitempty"`
	Transitions                    []*LifecycleTransition                   `xml:"Transition,omitempty"`
}

func (*LifecycleRule) Validate

func (r *LifecycleRule) Validate() error

Validate validates a single lifecycle rule

type LifecycleRuleAndOperator

type LifecycleRuleAndOperator struct {
	XMLName               xml.Name `xml:"And"`
	ObjectSizeGreaterThan *int64   `xml:"ObjectSizeGreaterThan,omitempty"`
	ObjectSizeLessThan    *int64   `xml:"ObjectSizeLessThan,omitempty"`
	Prefix                *string  `xml:"Prefix,omitempty"`
	Tags                  []*Tag   `xml:"Tag,omitempty"`
}

func (*LifecycleRuleAndOperator) Validate

func (a *LifecycleRuleAndOperator) Validate() error

Validate validates the And operator

type LifecycleStatus

type LifecycleStatus string
const (
	LifecycleStatusEnabled  LifecycleStatus = "Enabled"
	LifecycleStatusDisabled LifecycleStatus = "Disabled"
)

type LifecycleTransition

type LifecycleTransition struct {
	XMLName      xml.Name   `xml:"Transition"`
	Date         *time.Time `xml:"Date,omitempty"`
	Days         *int64     `xml:"Days,omitempty"`
	StorageClass *string    `xml:"StorageClass,omitempty"`
}

func (*LifecycleTransition) Validate

func (t *LifecycleTransition) Validate() error

Validate validates a single transition

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct {
	XMLName           xml.Name    `xml:"ListAllMyBucketsResult"`
	Xmlns             string      `xml:"xmlns,attr"`
	Owner             BucketOwner `xml:"Owner"`
	Buckets           BucketList  `xml:"Buckets"`
	ContinuationToken string      `xml:"ContinuationToken,omitempty"` // For paginated responses
	Prefix            string      `xml:"Prefix,omitempty"`            // Echo back prefix if provided
}

ListAllMyBucketsResult is the XML response for ListBuckets

type ListBucketIntelligentTieringConfigurationsResult

type ListBucketIntelligentTieringConfigurationsResult struct {
	XMLName xml.Name `xml:"ListBucketIntelligentTieringConfigurationsResult"`
	XMLNS   string   `xml:"xmlns,attr"`

	// Configurations is the list of configurations.
	Configurations []IntelligentTieringConfiguration `xml:"IntelligentTieringConfiguration,omitempty"`

	// IsTruncated indicates if there are more configurations.
	IsTruncated bool `xml:"IsTruncated"`

	// ContinuationToken for pagination.
	ContinuationToken string `xml:"ContinuationToken,omitempty"`

	// NextContinuationToken for fetching the next page.
	NextContinuationToken string `xml:"NextContinuationToken,omitempty"`
}

ListBucketIntelligentTieringConfigurationsResult is the response for listing configurations.

type ListMultipartUploadsResult

type ListMultipartUploadsResult struct {
	XMLName            xml.Name          `xml:"ListMultipartUploadsResult"`
	Xmlns              string            `xml:"xmlns,attr,omitempty"`
	Bucket             string            `xml:"Bucket"`
	KeyMarker          string            `xml:"KeyMarker"`
	UploadIDMarker     string            `xml:"UploadIdMarker"`
	NextKeyMarker      string            `xml:"NextKeyMarker,omitempty"`
	NextUploadIDMarker string            `xml:"NextUploadIdMarker,omitempty"`
	Delimiter          string            `xml:"Delimiter,omitempty"`
	Prefix             string            `xml:"Prefix,omitempty"`
	MaxUploads         int               `xml:"MaxUploads"`
	IsTruncated        bool              `xml:"IsTruncated"`
	Uploads            []MultipartUpload `xml:"Upload"`
	CommonPrefixes     []CommonPrefix    `xml:"CommonPrefixes,omitempty"`
}

ListMultipartUploadsResult is the response for ListMultipartUploads

type ListObjectEntry

type ListObjectEntry struct {
	Key          string       `xml:"Key"`
	LastModified string       `xml:"LastModified"`
	ETag         string       `xml:"ETag"`
	Size         int64        `xml:"Size"`
	StorageClass string       `xml:"StorageClass"`
	Owner        *ObjectOwner `xml:"Owner,omitempty"`
}

ListObjectEntry represents an object in list responses (v2)

type ListObjectsResult

type ListObjectsResult struct {
	XMLName        xml.Name        `xml:"ListBucketResult"`
	Xmlns          string          `xml:"xmlns,attr"`
	Name           string          `xml:"Name"`
	Prefix         string          `xml:"Prefix"`
	Marker         string          `xml:"Marker,omitempty"`
	Delimiter      string          `xml:"Delimiter,omitempty"`
	MaxKeys        int             `xml:"MaxKeys"`
	IsTruncated    bool            `xml:"IsTruncated"`
	NextMarker     string          `xml:"NextMarker,omitempty"`
	Contents       []ObjectContent `xml:"Contents"`
	CommonPrefixes []CommonPrefix  `xml:"CommonPrefixes,omitempty"`
}

ListObjectsResult represents the XML response for ListObjects (v1)

type ListObjectsV2Result

type ListObjectsV2Result struct {
	XMLName               xml.Name          `xml:"ListBucketResult"`
	Xmlns                 string            `xml:"xmlns,attr"`
	Name                  string            `xml:"Name"`
	Prefix                string            `xml:"Prefix"`
	Delimiter             string            `xml:"Delimiter,omitempty"`
	MaxKeys               int               `xml:"MaxKeys"`
	KeyCount              int               `xml:"KeyCount"`
	IsTruncated           bool              `xml:"IsTruncated"`
	Contents              []ListObjectEntry `xml:"Contents"`
	CommonPrefixes        []CommonPrefix    `xml:"CommonPrefixes,omitempty"`
	ContinuationToken     string            `xml:"ContinuationToken,omitempty"`
	NextContinuationToken string            `xml:"NextContinuationToken,omitempty"`
	StartAfter            string            `xml:"StartAfter,omitempty"`
	EncodingType          string            `xml:"EncodingType,omitempty"`
}

ListObjectsV2Result is the XML response for ListObjectsV2

type ListPartsResult

type ListPartsResult struct {
	XMLName              xml.Name   `xml:"ListPartsResult"`
	Xmlns                string     `xml:"xmlns,attr,omitempty"`
	Bucket               string     `xml:"Bucket"`
	Key                  string     `xml:"Key"`
	UploadID             string     `xml:"UploadId"`
	Initiator            *Initiator `xml:"Initiator,omitempty"`
	Owner                *Owner     `xml:"Owner,omitempty"`
	StorageClass         string     `xml:"StorageClass"`
	PartNumberMarker     int        `xml:"PartNumberMarker"`
	NextPartNumberMarker int        `xml:"NextPartNumberMarker"`
	MaxParts             int        `xml:"MaxParts"`
	IsTruncated          bool       `xml:"IsTruncated"`
	Parts                []PartInfo `xml:"Part"`
}

ListPartsResult is the response for ListParts

type ListVersionsResult

type ListVersionsResult struct {
	XMLName             xml.Name        `xml:"ListVersionsResult"`
	Xmlns               string          `xml:"xmlns,attr,omitempty"`
	Name                string          `xml:"Name"`
	Prefix              string          `xml:"Prefix,omitempty"`
	KeyMarker           string          `xml:"KeyMarker,omitempty"`
	VersionIDMarker     string          `xml:"VersionIdMarker,omitempty"`
	NextKeyMarker       string          `xml:"NextKeyMarker,omitempty"`
	NextVersionIDMarker string          `xml:"NextVersionIdMarker,omitempty"`
	MaxKeys             int             `xml:"MaxKeys"`
	Delimiter           string          `xml:"Delimiter,omitempty"`
	IsTruncated         bool            `xml:"IsTruncated"`
	Versions            []ObjectVersion `xml:"Version"`
	DeleteMarkers       []DeleteMarker  `xml:"DeleteMarker,omitempty"`
	CommonPrefixes      []CommonPrefix  `xml:"CommonPrefixes,omitempty"`
}

ListVersionsResult is the XML response for ListObjectVersions

type LocationConstraint

type LocationConstraint struct {
	XMLName  xml.Name `xml:"LocationConstraint"`
	Xmlns    string   `xml:"xmlns,attr,omitempty"`
	Location string   `xml:",chardata"`
}

LocationConstraint is the XML response for GetBucketLocation

type LoggingRule

type LoggingRule struct {
	TargetBucket string `xml:"TargetBucket"`
	TargetPrefix string `xml:"TargetPrefix"`
}

type MultipartUpload

type MultipartUpload struct {
	Key          string     `xml:"Key"`
	UploadID     string     `xml:"UploadId"`
	Initiator    *Initiator `xml:"Initiator,omitempty"`
	Owner        *Owner     `xml:"Owner,omitempty"`
	StorageClass string     `xml:"StorageClass"`
	Initiated    string     `xml:"Initiated"`
}

MultipartUpload represents an in-progress multipart upload

type NotificationConfiguration

type NotificationConfiguration struct {
	XMLName                      xml.Name                      `xml:"NotificationConfiguration" json:"-"`
	TopicConfigurations          []TopicConfiguration          `xml:"TopicConfiguration,omitempty" json:"topic_configurations,omitempty"`
	QueueConfigurations          []QueueConfiguration          `xml:"QueueConfiguration,omitempty" json:"queue_configurations,omitempty"`
	LambdaFunctionConfigurations []LambdaFunctionConfiguration `xml:"CloudFunctionConfiguration,omitempty" json:"lambda_configurations,omitempty"`
}

NotificationConfiguration defines event notification settings.

type NotificationFilter

type NotificationFilter struct {
	Key *NotificationFilterKey `xml:"S3Key,omitempty" json:"key,omitempty"`
}

NotificationFilter filters which objects trigger notifications.

type NotificationFilterKey

type NotificationFilterKey struct {
	FilterRules []NotificationFilterRule `xml:"FilterRule" json:"filter_rules"`
}

NotificationFilterKey filters by object key.

type NotificationFilterRule

type NotificationFilterRule struct {
	Name  string `xml:"Name" json:"name"` // prefix or suffix
	Value string `xml:"Value" json:"value"`
}

NotificationFilterRule is a key filter rule for notifications.

type Object

type Object struct {
	Name              string
	Size              int64
	ContentType       string
	ETag              string
	ChecksumAlgorithm ChecksumAlgorithm
	ChecksumValue     string
	StorageClass      StorageClass
}

type ObjectAttributesChecksum

type ObjectAttributesChecksum struct {
	ChecksumCRC32     string `xml:"ChecksumCRC32,omitempty"`
	ChecksumCRC32C    string `xml:"ChecksumCRC32C,omitempty"`
	ChecksumSHA1      string `xml:"ChecksumSHA1,omitempty"`
	ChecksumSHA256    string `xml:"ChecksumSHA256,omitempty"`
	ChecksumCRC64NVME string `xml:"ChecksumCRC64NVME,omitempty"`
}

ObjectAttributesChecksum contains checksum information for an object

type ObjectAttributesPart

type ObjectAttributesPart struct {
	PartNumber     int    `xml:"PartNumber,omitempty"`
	Size           int64  `xml:"Size,omitempty"`
	ChecksumCRC32  string `xml:"ChecksumCRC32,omitempty"`
	ChecksumCRC32C string `xml:"ChecksumCRC32C,omitempty"`
	ChecksumSHA1   string `xml:"ChecksumSHA1,omitempty"`
	ChecksumSHA256 string `xml:"ChecksumSHA256,omitempty"`
}

ObjectAttributesPart contains information about a single part

type ObjectAttributesParts

type ObjectAttributesParts struct {
	TotalPartsCount      int                    `xml:"TotalPartsCount,omitempty"`
	PartNumberMarker     int                    `xml:"PartNumberMarker,omitempty"`
	NextPartNumberMarker int                    `xml:"NextPartNumberMarker,omitempty"`
	MaxParts             int                    `xml:"MaxParts,omitempty"`
	IsTruncated          bool                   `xml:"IsTruncated,omitempty"`
	Parts                []ObjectAttributesPart `xml:"Part,omitempty"`
}

ObjectAttributesParts contains multipart upload part information

type ObjectContent

type ObjectContent struct {
	Key          string `xml:"Key"`
	LastModified string `xml:"LastModified"`
	ETag         string `xml:"ETag"`
	Size         uint64 `xml:"Size"`
	StorageClass string `xml:"StorageClass"`
}

ObjectContent represents an object in list responses (v1)

type ObjectLockConfiguration

type ObjectLockConfiguration struct {
	XMLName           xml.Name        `xml:"ObjectLockConfiguration" json:"-"`
	ObjectLockEnabled string          `xml:"ObjectLockEnabled" json:"object_lock_enabled"` // "Enabled"
	Rule              *ObjectLockRule `xml:"Rule,omitempty" json:"rule,omitempty"`
}

ObjectLockConfiguration defines WORM (Write Once Read Many) settings.

type ObjectLockLegalHold

type ObjectLockLegalHold struct {
	XMLName xml.Name `xml:"LegalHold" json:"-"`
	Status  string   `xml:"Status" json:"status"` // ON or OFF
}

ObjectLockLegalHold defines legal hold status.

type ObjectLockRetention

type ObjectLockRetention struct {
	XMLName         xml.Name `xml:"Retention" json:"-"`
	Mode            string   `xml:"Mode" json:"mode"`
	RetainUntilDate string   `xml:"RetainUntilDate" json:"retain_until_date"`
}

ObjectLockRetention defines per-object retention.

type ObjectLockRule

type ObjectLockRule struct {
	DefaultRetention *DefaultRetention `xml:"DefaultRetention" json:"default_retention"`
}

ObjectLockRule defines default retention settings.

type ObjectOwner

type ObjectOwner struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

ObjectOwner represents an object owner in list responses

type ObjectState

type ObjectState struct {
	// Object name/key
	Name string
	// Object size in bytes
	Size int64
	// Object modification time
	ModTime time.Time
	// Is this the latest version?
	IsLatest bool
	// Is this a delete marker?
	DeleteMarker bool
	// Version ID
	VersionID string
	// Object tags as URL query string (e.g., "key1=val1&key2=val2")
	UserTags string
	// Successor modification time (for noncurrent versions)
	SuccessorModTime time.Time
	// Total number of versions
	NumVersions int
}

ObjectState contains object metadata for lifecycle evaluation This is separate from Object because lifecycle needs version/state info that isn't part of the object's content metadata

func NewObjectState

func NewObjectState(obj *Object, modTime time.Time, isLatest bool, versionID string) *ObjectState

NewObjectState creates an ObjectState from an Object with version metadata

type ObjectVersion

type ObjectVersion struct {
	Key          string `xml:"Key"`
	VersionID    string `xml:"VersionId"`
	IsLatest     bool   `xml:"IsLatest"`
	LastModified string `xml:"LastModified"`
	ETag         string `xml:"ETag"`
	Size         int64  `xml:"Size"`
	StorageClass string `xml:"StorageClass"`
	Owner        *Owner `xml:"Owner,omitempty"`
}

ObjectVersion represents a version of an object

type Owner

type Owner struct {
	ID          string `xml:"ID" json:"id"`
	DisplayName string `xml:"DisplayName,omitempty" json:"display_name,omitempty"`
}

Owner identifies the owner of an object or bucket

type OwnershipControls

type OwnershipControls struct {
	XMLName xml.Name                `xml:"OwnershipControls" json:"-"`
	Rules   []OwnershipControlsRule `xml:"Rule" json:"rules"`
}

OwnershipControls defines object ownership settings.

type OwnershipControlsRule

type OwnershipControlsRule struct {
	ObjectOwnership string `xml:"ObjectOwnership" json:"object_ownership"` // BucketOwnerPreferred, ObjectWriter, BucketOwnerEnforced
}

OwnershipControlsRule defines an ownership rule.

type PartInfo

type PartInfo struct {
	PartNumber   int    `xml:"PartNumber"`
	LastModified string `xml:"LastModified"`
	ETag         string `xml:"ETag"`
	Size         int64  `xml:"Size"`
}

PartInfo represents a part in list responses

type Permission

type Permission string

ACL permission types

const (
	PermissionFullControl Permission = "FULL_CONTROL"
	PermissionRead        Permission = "READ"
	PermissionWrite       Permission = "WRITE"
	PermissionReadACP     Permission = "READ_ACP"
	PermissionWriteACP    Permission = "WRITE_ACP"
)

type PolicyEvaluationContext

type PolicyEvaluationContext struct {
	// Request info
	SourceIP  net.IP
	IsHTTPS   bool
	Timestamp time.Time
	UserAgent string
	Referer   string

	// Principal info
	AccountID string // Canonical user ID making the request
	UserARN   string // ARN of the user/role

	// Resource info
	Bucket string
	Key    string
}

PolicyEvaluationContext contains request metadata for policy evaluation

type PostObjectResponse

type PostObjectResponse struct {
	XMLName  xml.Name `xml:"PostResponse"`
	Location string   `xml:"Location,omitempty"`
	Bucket   string   `xml:"Bucket"`
	Key      string   `xml:"Key"`
	ETag     string   `xml:"ETag"`
}

PostObjectResponse is the XML response for successful POST object uploads when success_action_status is 200 or 201

type Principal

type Principal struct {
	AWS       []string `json:"AWS,omitempty"`       // AWS account IDs or ARNs
	Service   []string `json:"Service,omitempty"`   // AWS services
	Federated []string `json:"Federated,omitempty"` // Federated identity providers
}

Principal represents who the policy applies to

func (*Principal) IsPublic

func (p *Principal) IsPublic() bool

IsPublic returns true if the principal allows public access

func (*Principal) UnmarshalJSON

func (p *Principal) UnmarshalJSON(data []byte) error

UnmarshalJSON handles both string "*" and object forms of Principal

type PublicAccessBlockConfig

type PublicAccessBlockConfig struct {
	XMLName               xml.Name `xml:"PublicAccessBlockConfiguration" json:"-"`
	BlockPublicAcls       bool     `xml:"BlockPublicAcls" json:"block_public_acls"`
	IgnorePublicAcls      bool     `xml:"IgnorePublicAcls" json:"ignore_public_acls"`
	BlockPublicPolicy     bool     `xml:"BlockPublicPolicy" json:"block_public_policy"`
	RestrictPublicBuckets bool     `xml:"RestrictPublicBuckets" json:"restrict_public_buckets"`
}

PublicAccessBlockConfig blocks public access.

type QueueConfiguration

type QueueConfiguration struct {
	ID       string              `xml:"Id,omitempty" json:"id,omitempty"`
	QueueArn string              `xml:"Queue" json:"queue_arn"`
	Events   []string            `xml:"Event" json:"events"`
	Filter   *NotificationFilter `xml:"Filter,omitempty" json:"filter,omitempty"`
}

QueueConfiguration defines SQS queue notification.

type RedirectAllRequestsTo

type RedirectAllRequestsTo struct {
	HostName string `xml:"HostName" json:"host_name"`
	Protocol string `xml:"Protocol,omitempty" json:"protocol,omitempty"`
}

RedirectAllRequestsTo redirects all requests to another host.

type ReplicaModifications

type ReplicaModifications struct {
	Status string `xml:"Status"` // "Enabled" or "Disabled"
}

ReplicaModifications controls replication of metadata changes.

type ReplicationAnd

type ReplicationAnd struct {
	Prefix string `xml:"Prefix,omitempty"`
	Tags   []Tag  `xml:"Tag,omitempty"`
}

ReplicationAnd combines multiple filter conditions.

type ReplicationConfiguration

type ReplicationConfiguration struct {
	XMLName xml.Name          `xml:"ReplicationConfiguration"`
	Role    string            `xml:"Role"` // IAM role ARN (optional for ZapFS)
	Rules   []ReplicationRule `xml:"Rule"`
}

ReplicationConfiguration defines cross-region replication rules for a bucket. https://docs.aws.amazon.com/AmazonS3/latest/API/API_ReplicationConfiguration.html

type ReplicationDestination

type ReplicationDestination struct {
	// Bucket ARN or bucket name (ZapFS also accepts just the bucket name)
	Bucket string `xml:"Bucket"`

	// Optional: Account ID of destination bucket owner
	Account string `xml:"Account,omitempty"`

	// Optional: Storage class for replicated objects
	StorageClass string `xml:"StorageClass,omitempty"`

	// Optional: Encryption configuration
	EncryptionConfiguration *EncryptionConfiguration `xml:"EncryptionConfiguration,omitempty"`

	// Optional: Replica modifications
	ReplicaModifications *ReplicaModifications `xml:"ReplicaModifications,omitempty"`

	// Optional: Access control translation
	AccessControlTranslation *AccessControlTranslation `xml:"AccessControlTranslation,omitempty"`

	// Optional: Metrics configuration
	Metrics *ReplicationMetrics `xml:"Metrics,omitempty"`

	// Optional: Replication time control
	ReplicationTime *ReplicationTime `xml:"ReplicationTime,omitempty"`
}

ReplicationDestination defines where objects are replicated to.

type ReplicationEventThreshold

type ReplicationEventThreshold struct {
	Minutes int `xml:"Minutes"`
}

ReplicationEventThreshold defines when events are generated.

type ReplicationMetrics

type ReplicationMetrics struct {
	Status         string                     `xml:"Status"` // "Enabled" or "Disabled"
	EventThreshold *ReplicationEventThreshold `xml:"EventThreshold,omitempty"`
}

ReplicationMetrics contains metrics configuration.

type ReplicationRule

type ReplicationRule struct {
	ID       string                 `xml:"ID,omitempty"`
	Priority int                    `xml:"Priority,omitempty"`
	Status   ReplicationRuleStatus  `xml:"Status"`
	Filter   *ReplicationRuleFilter `xml:"Filter,omitempty"`

	// Prefix is deprecated but still supported
	Prefix string `xml:"Prefix,omitempty"`

	// Destination configuration
	Destination ReplicationDestination `xml:"Destination"`

	// Optional features
	DeleteMarkerReplication   *DeleteMarkerReplication   `xml:"DeleteMarkerReplication,omitempty"`
	ExistingObjectReplication *ExistingObjectReplication `xml:"ExistingObjectReplication,omitempty"`
	SourceSelectionCriteria   *SourceSelectionCriteria   `xml:"SourceSelectionCriteria,omitempty"`
}

ReplicationRule defines a single replication rule.

type ReplicationRuleFilter

type ReplicationRuleFilter struct {
	Prefix string          `xml:"Prefix,omitempty"`
	Tag    *Tag            `xml:"Tag,omitempty"`
	And    *ReplicationAnd `xml:"And,omitempty"`
}

ReplicationRuleFilter defines which objects are replicated.

type ReplicationRuleStatus

type ReplicationRuleStatus string

ReplicationRuleStatus indicates if a rule is enabled.

const (
	ReplicationRuleStatusEnabled  ReplicationRuleStatus = "Enabled"
	ReplicationRuleStatusDisabled ReplicationRuleStatus = "Disabled"
)

type ReplicationTime

type ReplicationTime struct {
	Status string                `xml:"Status"` // "Enabled" or "Disabled"
	Time   *ReplicationTimeValue `xml:"Time,omitempty"`
}

ReplicationTime defines replication time control settings.

type ReplicationTimeValue

type ReplicationTimeValue struct {
	Minutes int `xml:"Minutes"`
}

ReplicationTimeValue defines the replication time target.

type RequestPaymentConfig

type RequestPaymentConfig struct {
	XMLName xml.Name `xml:"RequestPaymentConfiguration" json:"-"`
	Payer   string   `xml:"Payer" json:"payer"` // BucketOwner or Requester
}

RequestPaymentConfig defines who pays for requests.

type RoutingCondition

type RoutingCondition struct {
	HttpErrorCodeReturnedEquals string `xml:"HttpErrorCodeReturnedEquals,omitempty" json:"http_error_code,omitempty"`
	KeyPrefixEquals             string `xml:"KeyPrefixEquals,omitempty" json:"key_prefix,omitempty"`
}

RoutingCondition defines when to apply a routing rule.

type RoutingRedirect

type RoutingRedirect struct {
	HostName             string `xml:"HostName,omitempty" json:"host_name,omitempty"`
	HttpRedirectCode     string `xml:"HttpRedirectCode,omitempty" json:"http_redirect_code,omitempty"`
	Protocol             string `xml:"Protocol,omitempty" json:"protocol,omitempty"`
	ReplaceKeyPrefixWith string `xml:"ReplaceKeyPrefixWith,omitempty" json:"replace_key_prefix_with,omitempty"`
	ReplaceKeyWith       string `xml:"ReplaceKeyWith,omitempty" json:"replace_key_with,omitempty"`
}

RoutingRedirect defines where to redirect.

type RoutingRule

type RoutingRule struct {
	Condition *RoutingCondition `xml:"Condition,omitempty" json:"condition,omitempty"`
	Redirect  *RoutingRedirect  `xml:"Redirect" json:"redirect"`
}

RoutingRule defines a website routing rule.

type RoutingRules

type RoutingRules struct {
	Rules []RoutingRule `xml:"RoutingRule" json:"rules"`
}

RoutingRules is a list of routing rules.

type S3Action

type S3Action string

S3Action represents an S3 action that can be performed Follows AWS S3 action naming: s3:GetObject, s3:PutObject, etc.

const (
	// Object actions
	S3ActionGetObject                S3Action = "s3:GetObject"
	S3ActionGetObjectVersion         S3Action = "s3:GetObjectVersion"
	S3ActionPutObject                S3Action = "s3:PutObject"
	S3ActionDeleteObject             S3Action = "s3:DeleteObject"
	S3ActionDeleteObjectVersion      S3Action = "s3:DeleteObjectVersion"
	S3ActionCopyObject               S3Action = "s3:CopyObject"
	S3ActionHeadObject               S3Action = "s3:HeadObject"
	S3ActionGetObjectTagging         S3Action = "s3:GetObjectTagging"
	S3ActionPutObjectTagging         S3Action = "s3:PutObjectTagging"
	S3ActionDeleteObjectTagging      S3Action = "s3:DeleteObjectTagging"
	S3ActionGetObjectAcl             S3Action = "s3:GetObjectAcl"
	S3ActionPutObjectAcl             S3Action = "s3:PutObjectAcl"
	S3ActionRestoreObject            S3Action = "s3:RestoreObject"
	S3ActionAbortMultipartUpload     S3Action = "s3:AbortMultipartUpload"
	S3ActionListMultipartUploadParts S3Action = "s3:ListMultipartUploadParts"

	// Bucket actions
	S3ActionListBucket                 S3Action = "s3:ListBucket"
	S3ActionListBucketVersions         S3Action = "s3:ListBucketVersions"
	S3ActionListBucketMultipartUploads S3Action = "s3:ListBucketMultipartUploads"
	S3ActionCreateBucket               S3Action = "s3:CreateBucket"
	S3ActionDeleteBucket               S3Action = "s3:DeleteBucket"
	S3ActionGetBucketLocation          S3Action = "s3:GetBucketLocation"
	S3ActionGetBucketPolicy            S3Action = "s3:GetBucketPolicy"
	S3ActionPutBucketPolicy            S3Action = "s3:PutBucketPolicy"
	S3ActionDeleteBucketPolicy         S3Action = "s3:DeleteBucketPolicy"
	S3ActionGetBucketAcl               S3Action = "s3:GetBucketAcl"
	S3ActionPutBucketAcl               S3Action = "s3:PutBucketAcl"
	S3ActionGetBucketVersioning        S3Action = "s3:GetBucketVersioning"
	S3ActionPutBucketVersioning        S3Action = "s3:PutBucketVersioning"
	S3ActionGetBucketLifecycle         S3Action = "s3:GetLifecycleConfiguration"
	S3ActionPutBucketLifecycle         S3Action = "s3:PutLifecycleConfiguration"
	S3ActionGetBucketTagging           S3Action = "s3:GetBucketTagging"
	S3ActionPutBucketTagging           S3Action = "s3:PutBucketTagging"

	// Service actions
	S3ActionListAllMyBuckets S3Action = "s3:ListAllMyBuckets"

	// Wildcards
	S3ActionAll       S3Action = "s3:*"
	S3ActionAllGet    S3Action = "s3:Get*"
	S3ActionAllPut    S3Action = "s3:Put*"
	S3ActionAllDelete S3Action = "s3:Delete*"
	S3ActionAllList   S3Action = "s3:List*"
)

type ServerSideEncryptionConfig

type ServerSideEncryptionConfig struct {
	XMLName xml.Name                   `xml:"ServerSideEncryptionConfiguration" json:"-"`
	Rules   []ServerSideEncryptionRule `xml:"Rule" json:"rules"`
}

ServerSideEncryptionConfig defines default bucket encryption.

type ServerSideEncryptionRule

type ServerSideEncryptionRule struct {
	ApplyServerSideEncryptionByDefault *EncryptionByDefault `xml:"ApplyServerSideEncryptionByDefault" json:"apply_default"`
	BucketKeyEnabled                   bool                 `xml:"BucketKeyEnabled,omitempty" json:"bucket_key_enabled,omitempty"`
}

ServerSideEncryptionRule defines an encryption rule.

type SourceSelectionCriteria

type SourceSelectionCriteria struct {
	SseKmsEncryptedObjects *SseKmsEncryptedObjects `xml:"SseKmsEncryptedObjects,omitempty"`
	ReplicaModifications   *ReplicaModifications   `xml:"ReplicaModifications,omitempty"`
}

SourceSelectionCriteria defines additional source selection criteria.

type SseKmsEncryptedObjects

type SseKmsEncryptedObjects struct {
	Status string `xml:"Status"` // "Enabled" or "Disabled"
}

SseKmsEncryptedObjects controls replication of KMS-encrypted objects.

type Statement

type Statement struct {
	Sid          string               `json:"Sid,omitempty"`
	Effect       Effect               `json:"Effect"`
	Principal    *Principal           `json:"Principal,omitempty"`
	NotPrincipal *Principal           `json:"NotPrincipal,omitempty"`
	Actions      []S3Action           `json:"-"` // Custom unmarshal handles Action field
	NotActions   []S3Action           `json:"-"` // Custom unmarshal handles NotAction field
	Resources    []string             `json:"-"` // Custom unmarshal handles Resource field
	NotResources []string             `json:"-"` // Custom unmarshal handles NotResource field
	Condition    map[string]Condition `json:"Condition,omitempty"`
}

Statement represents a single permission statement in a bucket policy

func (Statement) MarshalJSON

func (s Statement) MarshalJSON() ([]byte, error)

MarshalJSON outputs Action/Resource as arrays (canonical form)

func (*Statement) UnmarshalJSON

func (s *Statement) UnmarshalJSON(data []byte) error

UnmarshalJSON handles both string and array forms of Action and Resource. AWS S3 policy JSON allows: "Action": "s3:GetObject" or "Action": ["s3:GetObject"]

type StorageClass

type StorageClass uint8
const (
	StorageClassUnknown StorageClass = iota
	StorageClassStandard
	StorageClassInfrequentAccess
	StorageClassGlacier
	StorageClassDeepArchive
	StorageClassIntelligentTiering
)

func ParseStorageClass

func ParseStorageClass(name string) (StorageClass, error)

func (StorageClass) String

func (sc StorageClass) String() string

type Tag

type Tag struct {
	XMLName xml.Name `xml:"Tag"`
	Key     string   `xml:"Key" json:"key"`
	Value   string   `xml:"Value" json:"value"`
}

Tag is a key-value pair for tagging resources. Note: This is the canonical Tag type used across the codebase. lifecycle.go has its own Tag type for historical reasons.

func (*Tag) Validate

func (t *Tag) Validate() error

Validate validates a tag

type TagSet

type TagSet struct {
	XMLName xml.Name `xml:"Tagging" json:"-"`
	Tags    []Tag    `xml:"TagSet>Tag" json:"tags"`
}

TagSet holds a set of tags for buckets or objects.

type Tiering

type Tiering struct {
	// AccessTier is the target tier: ARCHIVE_ACCESS or DEEP_ARCHIVE_ACCESS.
	AccessTier string `xml:"AccessTier"`

	// Days is the number of days without access before transitioning.
	Days int `xml:"Days"`
}

Tiering specifies when to transition objects to a specific access tier.

type TopicConfiguration

type TopicConfiguration struct {
	ID       string              `xml:"Id,omitempty" json:"id,omitempty"`
	TopicArn string              `xml:"Topic" json:"topic_arn"`
	Events   []string            `xml:"Event" json:"events"`
	Filter   *NotificationFilter `xml:"Filter,omitempty" json:"filter,omitempty"`
}

TopicConfiguration defines SNS topic notification.

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a validation error.

func (*ValidationError) Error

func (e *ValidationError) Error() string

type Versioning

type Versioning string

Versioning represents the versioning state of a bucket

const (
	VersioningEnabled   Versioning = "Enabled"
	VersioningSuspended Versioning = "Suspended"
	VersioningDisabled  Versioning = "" // Not set = disabled
)

type VersioningConfiguration

type VersioningConfiguration struct {
	XMLName   xml.Name `xml:"VersioningConfiguration"`
	Xmlns     string   `xml:"xmlns,attr,omitempty"`
	Status    string   `xml:"Status,omitempty"`    // Enabled or Suspended
	MFADelete string   `xml:"MfaDelete,omitempty"` // Disabled or Enabled (requires MFA)
}

VersioningConfiguration is the XML request/response for bucket versioning

type WebsiteConfiguration

type WebsiteConfiguration struct {
	XMLName               xml.Name               `xml:"WebsiteConfiguration" json:"-"`
	IndexDocument         *IndexDocument         `xml:"IndexDocument,omitempty" json:"index_document,omitempty"`
	ErrorDocument         *ErrorDocument         `xml:"ErrorDocument,omitempty" json:"error_document,omitempty"`
	RedirectAllRequestsTo *RedirectAllRequestsTo `xml:"RedirectAllRequestsTo,omitempty" json:"redirect_all,omitempty"`
	RoutingRules          *RoutingRules          `xml:"RoutingRules,omitempty" json:"routing_rules,omitempty"`
}

WebsiteConfiguration defines static website hosting.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL