data

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersioningUnversioned = "Unversioned"
	VersioningEnabled     = "Enabled"
	VersioningSuspended   = "Suspended"

	// BucketSettingsV1 describes v1 version identifier for the bucket settings file.
	BucketSettingsV1 = "1"
)
View Source
const (
	// BucketOwnerEnforced is a enforced state.
	BucketOwnerEnforced = iota
	// BucketOwnerPreferred is a preferred state.
	BucketOwnerPreferred
	// BucketOwnerPreferredAndRestricted is a preferred state with `bucket-owner-full-control` restriction applied.
	BucketOwnerPreferredAndRestricted
	// BucketOwnerObjectWriter is a object writer state.
	BucketOwnerObjectWriter
)
View Source
const (
	UnversionedObjectVersionID = "null"
)

Variables

This section is empty.

Functions

func SortPartInfo added in v0.33.0

func SortPartInfo(a, b *PartInfo) int

SortPartInfo sorts PartInfo for Number ASC, ServerCreated ASC.

Types

type BucketACLState added in v0.33.0

type BucketACLState uint32

BucketACLState is bucket ACL state.

type BucketInfo

type BucketInfo struct {
	Name               string
	CID                cid.ID
	Owner              user.ID
	Created            time.Time
	LocationConstraint string
	ObjectLockEnabled  bool
}

BucketInfo stores basic bucket data.

func (*BucketInfo) CORSObjectName added in v0.18.0

func (b *BucketInfo) CORSObjectName() string

CORSObjectName returns a system name for a bucket CORS configuration file.

func (*BucketInfo) NotificationConfigurationObjectName added in v0.19.0

func (b *BucketInfo) NotificationConfigurationObjectName() string

func (*BucketInfo) SettingsObjectName

func (b *BucketInfo) SettingsObjectName() string

SettingsObjectName is a system name for a bucket settings file.

type BucketOwner added in v0.37.0

type BucketOwner int

BucketOwner is bucket onwer state.

type BucketSettings added in v0.20.0

type BucketSettings struct {
	Versioning        string                   `json:"versioning"`
	LockConfiguration *ObjectLockConfiguration `json:"lock_configuration"`
	BucketOwner       BucketOwner              `json:"bucket_owner"`
}

BucketSettings stores settings such as versioning.

func (BucketSettings) Unversioned added in v0.22.0

func (b BucketSettings) Unversioned() bool

func (BucketSettings) VersioningEnabled added in v0.20.0

func (b BucketSettings) VersioningEnabled() bool

func (BucketSettings) VersioningSuspended added in v0.22.0

func (b BucketSettings) VersioningSuspended() bool

type CORSConfiguration added in v0.18.0

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

CORSConfiguration stores CORS configuration of a request.

type CORSRule added in v0.18.0

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

CORSRule stores rules for CORS in a bucket.

type ComprehensiveObjectInfo added in v0.35.0

type ComprehensiveObjectInfo struct {
	ID       oid.ID
	TagSet   map[string]string
	LockInfo *LockInfo
}

ComprehensiveObjectInfo represents metasearch result for object, with tags and lock data.

type DefaultRetention added in v0.20.0

type DefaultRetention struct {
	Days  int64  `xml:"Days" json:"Days"`
	Mode  string `xml:"Mode" json:"Mode"`
	Years int64  `xml:"Years" json:"Years"`
}

type ElementInfo added in v0.35.0

type ElementInfo struct {
	ID         oid.ID
	ElementID  int
	Attributes map[string]string
	Size       int64
	TotalSize  int64
}

ElementInfo represents small element in "big object" chain.

type ExtendedObjectInfo added in v0.22.0

type ExtendedObjectInfo struct {
	ObjectInfo  *ObjectInfo
	NodeVersion *NodeVersion
	IsLatest    bool
}

ExtendedObjectInfo contains additional node info to be able to sort versions by timestamp.

func (ExtendedObjectInfo) Version added in v0.24.0

func (e ExtendedObjectInfo) Version() string

type Filter added in v0.19.0

type Filter struct {
	Key Key `xml:"S3Key" json:"S3Key"`
}

type FilterRule added in v0.19.0

type FilterRule struct {
	Name  string `xml:"Name" json:"Name"`
	Value string `xml:"Value" json:"Value"`
}

type Key added in v0.19.0

type Key struct {
	FilterRules []FilterRule `xml:"FilterRule" json:"FilterRules"`
}

type LambdaFunctionConfiguration added in v0.19.0

type LambdaFunctionConfiguration struct{}

type LegalHold added in v0.20.0

type LegalHold struct {
	XMLName xml.Name `xml:"LegalHold" json:"-"`
	Status  string   `xml:"Status" json:"Status"`
}

type LegalHoldLock added in v0.22.0

type LegalHoldLock struct {
	Enabled bool
}

type LockInfo added in v0.22.0

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

LockInfo is lock information for a particular object.

func (LockInfo) IsCompliance added in v0.22.0

func (l LockInfo) IsCompliance() bool

func (LockInfo) IsLegalHoldSet added in v0.22.0

func (l LockInfo) IsLegalHoldSet() bool

func (LockInfo) IsRetentionSet added in v0.22.0

func (l LockInfo) IsRetentionSet() bool

func (LockInfo) LegalHold added in v0.22.0

func (l LockInfo) LegalHold() oid.ID

func (LockInfo) Retention added in v0.22.0

func (l LockInfo) Retention() oid.ID

func (*LockInfo) SetLegalHold added in v0.22.0

func (l *LockInfo) SetLegalHold(objID oid.ID)

func (*LockInfo) SetRetention added in v0.22.0

func (l *LockInfo) SetRetention(objID oid.ID, until string, isCompliance bool)

func (LockInfo) UntilDate added in v0.22.0

func (l LockInfo) UntilDate() string

type MultipartInfo added in v0.22.0

type MultipartInfo struct {
	ID           oid.ID
	Key          string
	UploadID     string
	Owner        user.ID
	Created      time.Time
	Meta         map[string]string
	CopiesNumber uint32
}

MultipartInfo is multipart upload information.

type NodeVersion added in v0.22.0

type NodeVersion struct {
	OID            oid.ID
	Timestamp      uint64
	ETag           string
	FilePath       string
	IsDeleteMarker bool
	IsUnversioned  bool
}

NodeVersion represent basic object metadata.

type NotificationConfiguration added in v0.19.0

type NotificationConfiguration struct {
	QueueConfigurations []QueueConfiguration `xml:"QueueConfiguration" json:"QueueConfigurations"`
	// Not supported topics
	TopicConfigurations          []TopicConfiguration          `xml:"TopicConfiguration" json:"TopicConfigurations"`
	LambdaFunctionConfigurations []LambdaFunctionConfiguration `xml:"CloudFunctionConfiguration" json:"CloudFunctionConfigurations"`
}

func (NotificationConfiguration) IsEmpty added in v0.19.0

func (n NotificationConfiguration) IsEmpty() bool

type NotificationInfo added in v0.22.0

type NotificationInfo struct {
	Name    string
	Version string
	Size    int64
	HashSum string
}

NotificationInfo store info to send s3 notification.

func NotificationInfoFromObject added in v0.22.0

func NotificationInfoFromObject(objInfo *ObjectInfo) *NotificationInfo

NotificationInfoFromObject creates new NotificationInfo from ObjectInfo.

type ObjectInfo

type ObjectInfo struct {
	ID             oid.ID
	CID            cid.ID
	IsDir          bool
	IsDeleteMarker bool

	Bucket      string
	Name        string
	Size        int64
	ContentType string
	Created     time.Time
	HashSum     string
	Owner       user.ID
	Headers     map[string]string
	Version     string
}

ObjectInfo holds S3 object data.

func (*ObjectInfo) Address

func (o *ObjectInfo) Address() oid.Address

Address returns object address.

func (*ObjectInfo) NiceName

func (o *ObjectInfo) NiceName() string

NiceName returns object name for cache.

func (*ObjectInfo) VersionID added in v0.24.0

func (o *ObjectInfo) VersionID() string

VersionID returns object version from ObjectInfo.

type ObjectListResponseContent added in v0.35.0

type ObjectListResponseContent struct {
	ID      oid.ID
	IsDir   bool
	Size    int64
	Owner   user.ID
	HashSum string
	Created time.Time
	Name    string
}

ObjectListResponseContent holds response data for object listing.

type ObjectLock added in v0.20.0

type ObjectLock struct {
	LegalHold *LegalHoldLock
	Retention *RetentionLock
}

type ObjectLockConfiguration added in v0.20.0

type ObjectLockConfiguration struct {
	XMLName           xml.Name        `xml:"ObjectLockConfiguration" json:"-"`
	ObjectLockEnabled string          `xml:"ObjectLockEnabled" json:"ObjectLockEnabled"`
	Rule              *ObjectLockRule `xml:"Rule" json:"Rule"`
}

func (*ObjectLockConfiguration) Decode added in v0.36.0

func (conf *ObjectLockConfiguration) Decode(value string) error

Decode unmarshal ObjectLockConfiguration from string.

func (*ObjectLockConfiguration) Encode added in v0.36.0

func (conf *ObjectLockConfiguration) Encode() string

Encode marshal ObjectLockConfiguration to string.

type ObjectLockRule added in v0.20.0

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

type PartInfo added in v0.22.0

type PartInfo struct {
	UploadID string
	Number   int
	OID      oid.ID
	Size     int64
	ETag     string
	// Creation time from the client.
	Created time.Time

	// MultipartHash contains internal state of the [hash.Hash] to calculate whole object payload hash.
	MultipartHash []byte
	// HomoHash contains internal state of the [hash.Hash] to calculate whole object homomorphic payload hash.
	HomoHash []byte
	// Elements contain [oid.ID] and size for each element for the current part.
	Elements []ElementInfo
}

PartInfo is upload information about part.

func (*PartInfo) ToHeaderString added in v0.22.0

func (p *PartInfo) ToHeaderString() string

ToHeaderString form short part representation to use in S3-Completed-Parts header.

type QueueConfiguration added in v0.19.0

type QueueConfiguration struct {
	ID       string   `xml:"Id" json:"Id"`
	QueueArn string   `xml:"Queue" json:"Queue"`
	Events   []string `xml:"Event" json:"Events"`
	Filter   Filter   `xml:"Filter" json:"Filter"`
}

type Retention added in v0.20.0

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

type RetentionLock added in v0.22.0

type RetentionLock struct {
	Until              time.Time
	IsCompliance       bool
	ByPassedGovernance bool
}

type TopicConfiguration added in v0.19.0

type TopicConfiguration struct{}

TopicConfiguration and LambdaFunctionConfiguration -- we don't support these configurations, but we need them to detect in notification configurations in requests.

Jump to

Keyboard shortcuts

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