Documentation ¶
Overview ¶
Package lifecycle contains all the lifecycle related data types and marshallers.
Index ¶
- type AbortIncompleteMultipartUpload
- type And
- type Configuration
- type Expiration
- func (e Expiration) IsDateNull() bool
- func (e Expiration) IsDaysNull() bool
- func (e Expiration) IsDeleteMarkerExpirationEnabled() bool
- func (e Expiration) IsNull() bool
- func (e Expiration) MarshalJSON() ([]byte, error)
- func (e Expiration) MarshalXML(en *xml.Encoder, startElement xml.StartElement) error
- type ExpirationDate
- type ExpirationDays
- type ExpireDeleteMarker
- type Filter
- type NoncurrentVersionExpiration
- type NoncurrentVersionTransition
- type Rule
- type Tag
- type Transition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbortIncompleteMultipartUpload ¶
type AbortIncompleteMultipartUpload struct { XMLName xml.Name `xml:"AbortIncompleteMultipartUpload,omitempty" json:"-"` DaysAfterInitiation ExpirationDays `xml:"DaysAfterInitiation,omitempty" json:"DaysAfterInitiation,omitempty"` }
AbortIncompleteMultipartUpload structure, not supported yet on MinIO
func (AbortIncompleteMultipartUpload) IsDaysNull ¶
func (n AbortIncompleteMultipartUpload) IsDaysNull() bool
IsDaysNull returns true if days field is null
func (AbortIncompleteMultipartUpload) MarshalXML ¶
func (n AbortIncompleteMultipartUpload) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML if days after initiation is set to non-zero value
type And ¶
type And struct { XMLName xml.Name `xml:"And" json:"-"` Prefix string `xml:"Prefix" json:"Prefix,omitempty"` Tags []Tag `xml:"Tag" json:"Tags,omitempty"` }
And And Rule for LifecycleTag, to be used in LifecycleRuleFilter
type Configuration ¶
type Configuration struct { XMLName xml.Name `xml:"LifecycleConfiguration,omitempty" json:"-"` Rules []Rule `xml:"Rule"` }
Configuration is a collection of Rule objects.
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration initializes a fresh lifecycle configuration for manipulation, such as setting and removing lifecycle rules and filters.
func (*Configuration) Empty ¶ added in v7.0.2
func (c *Configuration) Empty() bool
Empty check if lifecycle configuration is empty
type Expiration ¶
type Expiration struct { XMLName xml.Name `xml:"Expiration,omitempty" json:"-"` Date ExpirationDate `xml:"Date,omitempty" json:"Date,omitempty"` Days ExpirationDays `xml:"Days,omitempty" json:"Days,omitempty"` DeleteMarker ExpireDeleteMarker `xml:"ExpiredObjectDeleteMarker,omitempty"` }
Expiration structure - expiration details of lifecycle configuration
func (Expiration) IsDateNull ¶
func (e Expiration) IsDateNull() bool
IsDateNull returns true if date field is null
func (Expiration) IsDaysNull ¶
func (e Expiration) IsDaysNull() bool
IsDaysNull returns true if days field is null
func (Expiration) IsDeleteMarkerExpirationEnabled ¶ added in v7.0.8
func (e Expiration) IsDeleteMarkerExpirationEnabled() bool
IsDeleteMarkerExpirationEnabled returns true if the auto-expiration of delete marker is enabled
func (Expiration) IsNull ¶
func (e Expiration) IsNull() bool
IsNull returns true if both date and days fields are null
func (Expiration) MarshalJSON ¶ added in v7.0.13
func (e Expiration) MarshalJSON() ([]byte, error)
MarshalJSON customizes json encoding by removing empty day/date specification.
func (Expiration) MarshalXML ¶
func (e Expiration) MarshalXML(en *xml.Encoder, startElement xml.StartElement) error
MarshalXML is expiration is non null
type ExpirationDate ¶
ExpirationDate is a embedded type containing time.Time to unmarshal Date in Expiration
func (ExpirationDate) MarshalXML ¶
func (eDate ExpirationDate) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error
MarshalXML encodes expiration date if it is non-zero and encodes empty string otherwise
type ExpirationDays ¶
type ExpirationDays int
ExpirationDays is a type alias to unmarshal Days in Expiration
func (ExpirationDays) MarshalXML ¶
func (eDays ExpirationDays) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error
MarshalXML encodes number of days to expire if it is non-zero and encodes empty string otherwise
type ExpireDeleteMarker ¶
type ExpireDeleteMarker bool
ExpireDeleteMarker represents value of ExpiredObjectDeleteMarker field in Expiration XML element.
func (ExpireDeleteMarker) IsEnabled ¶ added in v7.0.8
func (b ExpireDeleteMarker) IsEnabled() bool
IsEnabled returns true if the auto delete-marker expiration is enabled
func (ExpireDeleteMarker) MarshalXML ¶
func (b ExpireDeleteMarker) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error
MarshalXML encodes delete marker boolean into an XML form.
type Filter ¶
type Filter struct { XMLName xml.Name `xml:"Filter" json:"-"` And And `xml:"And,omitempty" json:"And,omitempty"` Prefix string `xml:"Prefix,omitempty" json:"Prefix,omitempty"` Tag Tag `xml:"Tag,omitempty" json:"Tag,omitempty"` }
Filter will be used in selecting rule(s) for lifecycle configuration
func (Filter) MarshalJSON ¶ added in v7.0.13
MarshalJSON customizes json encoding by removing empty values.
func (Filter) MarshalXML ¶
MarshalXML - produces the xml representation of the Filter struct only one of Prefix, And and Tag should be present in the output.
type NoncurrentVersionExpiration ¶
type NoncurrentVersionExpiration struct { XMLName xml.Name `xml:"NoncurrentVersionExpiration" json:"-"` NoncurrentDays ExpirationDays `xml:"NoncurrentDays,omitempty"` }
NoncurrentVersionExpiration - Specifies when noncurrent object versions expire. Upon expiration, server permanently deletes the noncurrent object versions. Set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request server delete noncurrent object versions at a specific period in the object's lifetime.
func (NoncurrentVersionExpiration) IsDaysNull ¶
func (n NoncurrentVersionExpiration) IsDaysNull() bool
IsDaysNull returns true if days field is null
func (NoncurrentVersionExpiration) MarshalXML ¶
func (n NoncurrentVersionExpiration) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML if non-current days not set to non zero value
type NoncurrentVersionTransition ¶
type NoncurrentVersionTransition struct { XMLName xml.Name `xml:"NoncurrentVersionTransition,omitempty" json:"-"` StorageClass string `xml:"StorageClass,omitempty" json:"StorageClass,omitempty"` NoncurrentDays ExpirationDays `xml:"NoncurrentDays" json:"NoncurrentDays"` }
NoncurrentVersionTransition structure, set this action to request server to transition noncurrent object versions to different set storage classes at a specific period in the object's lifetime.
func (NoncurrentVersionTransition) IsDaysNull ¶ added in v7.0.7
func (n NoncurrentVersionTransition) IsDaysNull() bool
IsDaysNull returns true if days field is null
func (NoncurrentVersionTransition) IsStorageClassEmpty ¶ added in v7.0.11
func (n NoncurrentVersionTransition) IsStorageClassEmpty() bool
IsStorageClassEmpty returns true if storage class field is empty
func (NoncurrentVersionTransition) MarshalXML ¶
func (n NoncurrentVersionTransition) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML is extended to leave out <NoncurrentVersionTransition></NoncurrentVersionTransition> tags
func (*NoncurrentVersionTransition) UnmarshalJSON ¶ added in v7.0.15
func (n *NoncurrentVersionTransition) UnmarshalJSON(b []byte) error
type Rule ¶
type Rule struct { XMLName xml.Name `xml:"Rule,omitempty" json:"-"` AbortIncompleteMultipartUpload AbortIncompleteMultipartUpload `xml:"AbortIncompleteMultipartUpload,omitempty" json:"AbortIncompleteMultipartUpload,omitempty"` Expiration Expiration `xml:"Expiration,omitempty" json:"Expiration,omitempty"` ID string `xml:"ID" json:"ID"` RuleFilter Filter `xml:"Filter,omitempty" json:"Filter,omitempty"` NoncurrentVersionExpiration NoncurrentVersionExpiration `xml:"NoncurrentVersionExpiration,omitempty" json:"NoncurrentVersionExpiration,omitempty"` NoncurrentVersionTransition NoncurrentVersionTransition `xml:"NoncurrentVersionTransition,omitempty" json:"NoncurrentVersionTransition,omitempty"` Prefix string `xml:"Prefix,omitempty" json:"Prefix,omitempty"` Status string `xml:"Status" json:"Status"` Transition Transition `xml:"Transition,omitempty" json:"Transition,omitempty"` }
Rule represents a single rule in lifecycle configuration
func (Rule) MarshalJSON ¶ added in v7.0.13
MarshalJSON customizes json encoding by omitting empty values
type Tag ¶
type Tag struct { XMLName xml.Name `xml:"Tag,omitempty" json:"-"` Key string `xml:"Key,omitempty" json:"Key,omitempty"` Value string `xml:"Value,omitempty" json:"Value,omitempty"` }
Tag structure key/value pair representing an object tag to apply lifecycle configuration
type Transition ¶
type Transition struct { XMLName xml.Name `xml:"Transition" json:"-"` Date ExpirationDate `xml:"Date,omitempty" json:"Date,omitempty"` StorageClass string `xml:"StorageClass,omitempty" json:"StorageClass,omitempty"` Days ExpirationDays `xml:"Days" json:"Days"` }
Transition structure - transition details of lifecycle configuration
func (Transition) IsDateNull ¶
func (t Transition) IsDateNull() bool
IsDateNull returns true if date field is null
func (Transition) IsDaysNull ¶
func (t Transition) IsDaysNull() bool
IsDaysNull returns true if days field is null
func (Transition) IsNull ¶
func (t Transition) IsNull() bool
IsNull returns true if no storage-class is set.
func (Transition) MarshalJSON ¶ added in v7.0.13
func (t Transition) MarshalJSON() ([]byte, error)
MarshalJSON customizes json encoding by omitting empty values
func (Transition) MarshalXML ¶
func (t Transition) MarshalXML(en *xml.Encoder, startElement xml.StartElement) error
MarshalXML is transition is non null
func (*Transition) UnmarshalJSON ¶ added in v7.0.15
func (t *Transition) UnmarshalJSON(b []byte) error
UnmarshalJSON returns an error if storage-class is empty.