data

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersioningUnversioned = "Unversioned"
	VersioningEnabled     = "Enabled"
	VersioningSuspended   = "Suspended"
)
View Source
const (
	LifecycleStatusEnabled  = "Enabled"
	LifecycleStatusDisabled = "Disabled"
)
View Source
const (
	UnversionedObjectVersionID = "null"
)

Variables

This section is empty.

Functions

func Quote added in v0.29.0

func Quote(val string) string

func UnQuote added in v0.29.0

func UnQuote(val string) string

Types

type AbortIncompleteMultipartUpload added in v0.31.0

type AbortIncompleteMultipartUpload struct {
	DaysAfterInitiation *int `xml:"DaysAfterInitiation,omitempty"`
}

type BaseNodeVersion

type BaseNodeVersion struct {
	ID             uint64
	ParenID        uint64
	OID            oid.ID
	Timestamp      uint64
	Size           uint64
	ETag           string
	MD5            string
	FilePath       string
	Created        *time.Time
	Owner          *user.ID
	IsDeleteMarker bool
	CreationEpoch  uint64
}

BaseNodeVersion is minimal node info from tree service. Basically used for "system" object.

func (*BaseNodeVersion) FillExtra added in v0.29.0

func (v *BaseNodeVersion) FillExtra(owner *user.ID, created *time.Time, realSize uint64)

func (*BaseNodeVersion) GetETag added in v0.29.0

func (v *BaseNodeVersion) GetETag(md5Enabled bool) string

func (BaseNodeVersion) IsFilledExtra added in v0.29.0

func (v BaseNodeVersion) IsFilledExtra() bool

IsFilledExtra returns true is node was created by version of gate v0.29.x and later.

type BucketInfo

type BucketInfo struct {
	Name                    string // container name from system attribute
	Zone                    string // container zone from system attribute
	CID                     cid.ID
	Owner                   user.ID
	Created                 time.Time
	LocationConstraint      string
	ObjectLockEnabled       bool
	HomomorphicHashDisabled bool
	PlacementPolicy         netmap.PlacementPolicy
}

BucketInfo stores basic bucket data.

func (*BucketInfo) CORSObjectName

func (b *BucketInfo) CORSObjectName() string

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

func (*BucketInfo) LifecycleConfigurationObjectName added in v0.31.0

func (b *BucketInfo) LifecycleConfigurationObjectName() string

func (*BucketInfo) SettingsObjectName

func (b *BucketInfo) SettingsObjectName() string

SettingsObjectName is a system name for a bucket settings file.

type BucketSettings

type BucketSettings struct {
	Versioning        string
	LockConfiguration *ObjectLockConfiguration
	CannedACL         string
	OwnerKey          *keys.PublicKey
}

BucketSettings stores settings such as versioning.

func (BucketSettings) Unversioned

func (b BucketSettings) Unversioned() bool

func (BucketSettings) VersioningEnabled

func (b BucketSettings) VersioningEnabled() bool

func (BucketSettings) VersioningSuspended

func (b BucketSettings) VersioningSuspended() bool

type CORSConfiguration

type CORSConfiguration struct {
	XMLName   xml.Name   `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CORSConfiguration" json:"-"`
	CORSRules []CORSRule `xml:"CORSRule" json:"CORSRules"`
}

CORSConfiguration stores CORS configuration of a request.

type CORSRule

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 CreatedObjectInfo added in v0.31.0

type CreatedObjectInfo struct {
	ID            oid.ID
	Size          uint64
	HashSum       []byte
	MD5Sum        []byte
	CreationEpoch uint64
}

CreatedObjectInfo stores created object info.

type DefaultRetention

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

type ExtendedNodeVersion added in v0.29.0

type ExtendedNodeVersion struct {
	NodeVersion *NodeVersion
	IsLatest    bool
	DirName     string
}

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

func (ExtendedNodeVersion) Name added in v0.29.0

func (e ExtendedNodeVersion) Name() string

func (ExtendedNodeVersion) Version added in v0.29.0

func (e ExtendedNodeVersion) Version() string

type ExtendedObjectInfo

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

func (e ExtendedObjectInfo) Version() string

type GetObjectTaggingParams added in v0.30.0

type GetObjectTaggingParams struct {
	ObjectVersion *ObjectVersion

	// NodeVersion can be nil. If not nil we save one request to tree service.
	NodeVersion *NodeVersion // optional
}

type LegalHold

type LegalHold struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LegalHold" json:"-"`
	Status  string   `xml:"Status" json:"Status"`
}

type LegalHoldLock

type LegalHoldLock struct {
	Enabled bool
}

type LifecycleConfiguration added in v0.31.0

type LifecycleConfiguration struct {
	XMLName xml.Name        `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LifecycleConfiguration" json:"-"`
	Rules   []LifecycleRule `xml:"Rule"`
}

type LifecycleExpiration added in v0.31.0

type LifecycleExpiration struct {
	Date                      string  `xml:"Date,omitempty"`
	Days                      *int    `xml:"Days,omitempty"`
	Epoch                     *uint64 `xml:"Epoch,omitempty"`
	ExpiredObjectDeleteMarker *bool   `xml:"ExpiredObjectDeleteMarker,omitempty"`
}

type LifecycleRule added in v0.31.0

type LifecycleRule struct {
	Status                         string                          `xml:"Status,omitempty"`
	AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `xml:"AbortIncompleteMultipartUpload,omitempty"`
	Expiration                     *LifecycleExpiration            `xml:"Expiration,omitempty"`
	Filter                         *LifecycleRuleFilter            `xml:"Filter,omitempty"`
	ID                             string                          `xml:"ID,omitempty"`
	NonCurrentVersionExpiration    *NonCurrentVersionExpiration    `xml:"NoncurrentVersionExpiration,omitempty"`
	Prefix                         string                          `xml:"Prefix,omitempty"`
}

type LifecycleRuleAndOperator added in v0.31.0

type LifecycleRuleAndOperator struct {
	ObjectSizeGreaterThan *uint64 `xml:"ObjectSizeGreaterThan,omitempty"`
	ObjectSizeLessThan    *uint64 `xml:"ObjectSizeLessThan,omitempty"`
	Prefix                string  `xml:"Prefix,omitempty"`
	Tags                  []Tag   `xml:"Tag"`
}

type LifecycleRuleFilter added in v0.31.0

type LifecycleRuleFilter struct {
	And                   *LifecycleRuleAndOperator `xml:"And,omitempty"`
	ObjectSizeGreaterThan *uint64                   `xml:"ObjectSizeGreaterThan,omitempty"`
	ObjectSizeLessThan    *uint64                   `xml:"ObjectSizeLessThan,omitempty"`
	Prefix                string                    `xml:"Prefix,omitempty"`
	Tag                   *Tag                      `xml:"Tag,omitempty"`
}

type ListSession added in v0.29.0

type ListSession struct {
	Next     []*ExtendedNodeVersion
	Stream   VersionsStream
	NamesMap map[string]struct{}
	Context  context.Context
	Cancel   context.CancelFunc
	Acquired atomic.Bool
}

type LockInfo

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

LockInfo is lock information to create appropriate tree node.

func NewLockInfo

func NewLockInfo(id uint64) *LockInfo

func (LockInfo) ID

func (l LockInfo) ID() uint64

func (LockInfo) IsCompliance

func (l LockInfo) IsCompliance() bool

func (LockInfo) IsLegalHoldSet

func (l LockInfo) IsLegalHoldSet() bool

func (LockInfo) IsRetentionSet

func (l LockInfo) IsRetentionSet() bool

func (LockInfo) LegalHold

func (l LockInfo) LegalHold() oid.ID

func (*LockInfo) ResetLegalHold

func (l *LockInfo) ResetLegalHold()

func (LockInfo) Retention

func (l LockInfo) Retention() oid.ID

func (*LockInfo) SetLegalHold

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

func (*LockInfo) SetRetention

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

func (LockInfo) UntilDate

func (l LockInfo) UntilDate() string

type MultipartInfo

type MultipartInfo struct {
	// ID is node id in tree service.
	// It's ignored when creating a new multipart upload.
	ID            uint64
	Key           string
	UploadID      string
	Owner         user.ID
	Created       time.Time
	Meta          map[string]string
	CopiesNumbers []uint32
	Finished      bool
	CreationEpoch uint64
}

MultipartInfo is multipart upload information.

type NodeVersion

type NodeVersion struct {
	BaseNodeVersion
	IsUnversioned bool
	IsCombined    bool
}

NodeVersion represent node from tree service.

type NonCurrentVersionExpiration added in v0.31.0

type NonCurrentVersionExpiration struct {
	NewerNonCurrentVersions *int `xml:"NewerNoncurrentVersions,omitempty"`
	NonCurrentDays          *int `xml:"NoncurrentDays,omitempty"`
}

type ObjectInfo

type ObjectInfo struct {
	ID  oid.ID
	CID cid.ID

	Bucket        string
	Name          string
	Size          uint64
	ContentType   string
	Created       time.Time
	CreationEpoch uint64
	HashSum       string
	MD5Sum        string
	Owner         user.ID
	Headers       map[string]string
}

ObjectInfo holds S3 object data.

func (*ObjectInfo) Address

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

Address returns object address.

func (*ObjectInfo) ETag added in v0.28.1

func (o *ObjectInfo) ETag(md5Enabled bool) string

func (*ObjectInfo) NiceName

func (o *ObjectInfo) NiceName() string

NiceName returns object name for cache.

func (*ObjectInfo) VersionID

func (o *ObjectInfo) VersionID() string

VersionID returns object version from ObjectInfo.

type ObjectLock

type ObjectLock struct {
	LegalHold *LegalHoldLock
	Retention *RetentionLock
}

type ObjectLockConfiguration

type ObjectLockConfiguration struct {
	XMLName           xml.Name        `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ObjectLockConfiguration" json:"-"`
	ObjectLockEnabled string          `xml:"ObjectLockEnabled" json:"ObjectLockEnabled"`
	Rule              *ObjectLockRule `xml:"Rule" json:"Rule"`
}

type ObjectLockRule

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

type ObjectTaggingInfo

type ObjectTaggingInfo struct {
	CnrID     cid.ID
	ObjName   string
	VersionID string
}

type ObjectVersion added in v0.30.0

type ObjectVersion struct {
	BktInfo               *BucketInfo
	ObjectName            string
	VersionID             string
	NoErrorOnDeleteMarker bool
}

ObjectVersion stores object version info.

type PartInfo

type PartInfo struct {
	Key      string    `json:"key"`
	UploadID string    `json:"uploadId"`
	Number   int       `json:"number"`
	OID      oid.ID    `json:"oid"`
	Size     uint64    `json:"size"`
	ETag     string    `json:"etag"`
	MD5      string    `json:"md5"`
	Created  time.Time `json:"created"`
}

PartInfo is upload information about part.

func (*PartInfo) GetETag added in v0.28.1

func (p *PartInfo) GetETag(md5Enabled bool) string

func (*PartInfo) ToHeaderString

func (p *PartInfo) ToHeaderString() string

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

type PartInfoExtended added in v0.31.0

type PartInfoExtended struct {
	PartInfo

	// Timestamp is used to find the latest version of part info in case of tree split
	// when there are multiple nodes for the same part.
	Timestamp uint64
}

type PutObjectTaggingParams added in v0.30.0

type PutObjectTaggingParams struct {
	ObjectVersion *ObjectVersion
	TagSet        map[string]string

	// NodeVersion can be nil. If not nil we save one request to tree service.
	NodeVersion *NodeVersion // optional
}

type Retention

type Retention struct {
	XMLName         xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Retention" json:"-"`
	Mode            string   `xml:"Mode" json:"Mode"`
	RetainUntilDate string   `xml:"RetainUntilDate" json:"RetainUntilDate"`
}

type RetentionLock

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

type Tag added in v0.30.0

type Tag struct {
	Key   string
	Value string
}

Tag is an AWS key-value tag.

type Tagging added in v0.30.0

type Tagging struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Tagging"`
	TagSet  []Tag    `xml:"TagSet>Tag"`
}

Tagging contains tag set.

type VersionsStream added in v0.29.0

type VersionsStream interface {
	Next(ctx context.Context) (*NodeVersion, error)
}

Jump to

Keyboard shortcuts

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