types

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types/bucket.go

Package types/common.go

Package types types/multipart.go - Multipart upload related types

Package types/object.go

Package types/upload.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketInfo

type BucketInfo struct {
	// Bucket name
	Name string `json:"name"`
	// Creation date
	CreationDate time.Time `json:"creationDate"`
	// Bucket region
	Region string `json:"region,omitempty"`
}

BucketInfo contains bucket information

type BucketLookupType

type BucketLookupType int

BucketLookupType represents bucket lookup type

const (
	// BucketLookupAuto automatically detects
	BucketLookupAuto BucketLookupType = iota
	// BucketLookupDNS uses DNS style
	BucketLookupDNS
	// BucketLookupPath uses path style
	BucketLookupPath
)

type ChecksumType

type ChecksumType int

ChecksumType represents checksum type

const (
	ChecksumNone ChecksumType = iota
	ChecksumCRC32
	ChecksumCRC32C
	ChecksumSHA1
	ChecksumSHA256
	ChecksumCRC64NVME
)

func (ChecksumType) String

func (c ChecksumType) String() string

String returns the checksum type as a string

type CompletePart

type CompletePart struct {
	PartNumber        int
	ETag              string
	ChecksumCRC32     string
	ChecksumCRC32C    string
	ChecksumSHA1      string
	ChecksumSHA256    string
	ChecksumCRC64NVME string
}

CompletePart contains completed part information

type CopyInfo

type CopyInfo struct {
	Bucket            string
	Key               string
	ETag              string
	VersionID         string
	SourceVersionID   string
	LastModified      time.Time
	ChecksumCRC32     string
	ChecksumCRC32C    string
	ChecksumSHA1      string
	ChecksumSHA256    string
	ChecksumCRC64NVME string
}

CopyInfo contains copy information

type DeleteError

type DeleteError struct {
	Key       string
	VersionID string
	Code      string
	Message   string
}

DeleteError represents a delete error

type DeletedObject

type DeletedObject struct {
	Key                   string
	VersionID             string
	DeleteMarker          bool
	DeleteMarkerVersionID string
}

DeletedObject contains deleted object result

type Grant

type Grant struct {
	Grantee    Grantee
	Permission string
}

Grant represents ACL grant

type Grantee

type Grantee struct {
	Type        string
	ID          string
	DisplayName string
	URI         string
}

Grantee represents grantee information

type LegalHoldStatus

type LegalHoldStatus string

LegalHoldStatus represents legal hold status

const (
	LegalHoldOn  LegalHoldStatus = "ON"
	LegalHoldOff LegalHoldStatus = "OFF"
)

func (LegalHoldStatus) IsValid

func (l LegalHoldStatus) IsValid() bool

IsValid checks if the legal hold status is valid

type MultipartInfo

type MultipartInfo struct {
	// Upload ID
	UploadID string `json:"uploadId"`
	// Object key
	Key string `json:"key"`
	// Initiated time
	Initiated time.Time `json:"initiated"`
	// Initiator
	Initiator struct {
		ID          string
		DisplayName string
	} `json:"initiator,omitempty"`
	// Owner
	Owner Owner `json:"owner,omitempty"`
	// Storage class
	StorageClass string `json:"storageClass,omitempty"`
	// Size (aggregated)
	Size int64 `json:"size,omitempty"`
	// Error
	Err error `json:"-"`
}

MultipartInfo contains multipart upload information

type ObjectInfo

type ObjectInfo struct {
	// Basic information
	Key          string    `json:"name"`
	Size         int64     `json:"size"`
	ETag         string    `json:"etag"`
	ContentType  string    `json:"contentType"`
	LastModified time.Time `json:"lastModified"`
	Expires      time.Time `json:"expires,omitempty"`

	// Owner
	Owner Owner `json:"owner,omitempty"`

	// Storage class
	StorageClass string `json:"storageClass,omitempty"`

	// Version information
	VersionID      string `json:"versionId,omitempty"`
	IsLatest       bool   `json:"isLatest,omitempty"`
	IsDeleteMarker bool   `json:"isDeleteMarker,omitempty"`

	// Replication status
	ReplicationStatus string `json:"replicationStatus,omitempty"`

	// Metadata
	Metadata     http.Header `json:"metadata,omitempty"`
	UserMetadata StringMap   `json:"userMetadata,omitempty"`
	UserTags     URLMap      `json:"userTags,omitempty"`
	UserTagCount int         `json:"userTagCount,omitempty"`

	// Lifecycle
	Expiration       time.Time `json:"expiration,omitempty"`
	ExpirationRuleID string    `json:"expirationRuleId,omitempty"`

	// Restore information
	Restore *RestoreInfo `json:"restore,omitempty"`

	// Checksums
	ChecksumCRC32     string `json:"checksumCRC32,omitempty"`
	ChecksumCRC32C    string `json:"checksumCRC32C,omitempty"`
	ChecksumSHA1      string `json:"checksumSHA1,omitempty"`
	ChecksumSHA256    string `json:"checksumSHA256,omitempty"`
	ChecksumCRC64NVME string `json:"checksumCRC64NVME,omitempty"`
	ChecksumMode      string `json:"checksumMode,omitempty"`

	// ACL
	Grant []Grant `json:"grant,omitempty"`

	// Number of versions
	NumVersions int `json:"numVersions,omitempty"`

	// Internal information (EC encoding)
	Internal *struct {
		K int
		M int
	} `json:"internal,omitempty"`

	// Error (used for list operations)
	Err error `json:"-"`

	// IsPrefix indicates this entry is a common prefix (pseudo-directory)
	IsPrefix bool `json:"isPrefix,omitempty"`
}

ObjectInfo contains object metadata information

type ObjectPart

type ObjectPart struct {
	// PartNumber is the part number (starts from 1)
	PartNumber int `xml:"PartNumber"`
	// ETag is the part's ETag
	ETag string `xml:"ETag"`
	// Size is the part size
	Size int64 `xml:"Size,omitempty"`
	// LastModified is the last modified time
	LastModified string `xml:"LastModified,omitempty"`

	// Checksums
	ChecksumCRC32  string `xml:"ChecksumCRC32,omitempty"`
	ChecksumCRC32C string `xml:"ChecksumCRC32C,omitempty"`
	ChecksumSHA1   string `xml:"ChecksumSHA1,omitempty"`
	ChecksumSHA256 string `xml:"ChecksumSHA256,omitempty"`
}

ObjectPart contains object part information (used for multipart upload)

type ObjectToDelete

type ObjectToDelete struct {
	Key       string
	VersionID string
}

ObjectToDelete represents an object to be deleted

type Owner

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

Owner contains object owner information

type PartInfo

type PartInfo struct {
	// Part number
	PartNumber int `json:"partNumber"`
	// ETag
	ETag string `json:"etag"`
	// Size
	Size int64 `json:"size"`
	// Last modified time
	LastModified time.Time `json:"lastModified"`

	// Checksums
	ChecksumCRC32     string `json:"checksumCRC32,omitempty"`
	ChecksumCRC32C    string `json:"checksumCRC32C,omitempty"`
	ChecksumSHA1      string `json:"checksumSHA1,omitempty"`
	ChecksumSHA256    string `json:"checksumSHA256,omitempty"`
	ChecksumCRC64NVME string `json:"checksumCRC64NVME,omitempty"`
}

PartInfo contains part information

type ReplicationStatus

type ReplicationStatus string

ReplicationStatus represents replication status

const (
	ReplicationPending  ReplicationStatus = "PENDING"
	ReplicationComplete ReplicationStatus = "COMPLETED"
	ReplicationFailed   ReplicationStatus = "FAILED"
	ReplicationReplica  ReplicationStatus = "REPLICA"
)

type RestoreInfo

type RestoreInfo struct {
	OngoingRestore bool
	ExpiryTime     time.Time
}

RestoreInfo contains archive restore information

type RetentionMode

type RetentionMode string

RetentionMode represents retention mode

const (
	RetentionGovernance RetentionMode = "GOVERNANCE"
	RetentionCompliance RetentionMode = "COMPLIANCE"
)

func (RetentionMode) IsValid

func (r RetentionMode) IsValid() bool

IsValid checks if the retention mode is valid

type StringMap

type StringMap map[string]string

StringMap is a custom string map (used for XML parsing)

type URLMap

type URLMap map[string]string

URLMap is a URL-encoded map

type UploadInfo

type UploadInfo struct {
	// Bucket name
	Bucket string `json:"bucket"`
	// Object key
	Key string `json:"key"`
	// ETag
	ETag string `json:"etag"`
	// Size
	Size int64 `json:"size"`
	// Last modified time
	LastModified time.Time `json:"lastModified"`
	// Location
	Location string `json:"location,omitempty"`
	// Version ID
	VersionID string `json:"versionId,omitempty"`

	// Lifecycle expiration information
	Expiration       time.Time `json:"expiration,omitempty"`
	ExpirationRuleID string    `json:"expirationRuleId,omitempty"`

	// Checksums
	ChecksumCRC32     string `json:"checksumCRC32,omitempty"`
	ChecksumCRC32C    string `json:"checksumCRC32C,omitempty"`
	ChecksumSHA1      string `json:"checksumSHA1,omitempty"`
	ChecksumSHA256    string `json:"checksumSHA256,omitempty"`
	ChecksumCRC64NVME string `json:"checksumCRC64NVME,omitempty"`
	ChecksumMode      string `json:"checksumMode,omitempty"`
}

UploadInfo contains upload result information

type VersioningConfig

type VersioningConfig struct {
	Status    string // Enabled, Suspended
	MFADelete string // Enabled, Disabled
}

VersioningConfig contains versioning configuration

func (VersioningConfig) IsEnabled

func (v VersioningConfig) IsEnabled() bool

IsEnabled checks if versioning is enabled

func (VersioningConfig) IsSuspended

func (v VersioningConfig) IsSuspended() bool

IsSuspended checks if versioning is suspended

Jump to

Keyboard shortcuts

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