lifecycle

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package lifecycle contains all the lifecycle related data types and marshallers.

Index

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

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

func (And) IsEmpty

func (a And) IsEmpty() bool

IsEmpty returns true if Tags field is null

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

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" json:"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

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

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

type ExpirationDate struct {
	time.Time
}

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

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) IsNull

func (f Filter) IsNull() bool

IsNull returns true if all Filter fields are empty.

func (Filter) MarshalJSON

func (f Filter) MarshalJSON() ([]byte, error)

MarshalJSON customizes json encoding by removing empty values.

func (Filter) MarshalXML

func (f Filter) MarshalXML(e *xml.Encoder, start xml.StartElement) error

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"`
	NewerNoncurrentVersions int            `xml:"NewerNoncurrentVersions,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 n is non-empty, i.e has a non-zero NoncurrentDays or NewerNoncurrentVersions.

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"`
	NewerNoncurrentVersions int            `xml:"NewerNoncurrentVersions,omitempty" json:"NewerNoncurrentVersions,omitempty"`
}

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

func (n NoncurrentVersionTransition) IsDaysNull() bool

IsDaysNull returns true if days field is null

func (NoncurrentVersionTransition) IsStorageClassEmpty

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

func (n *NoncurrentVersionTransition) UnmarshalJSON(b []byte) error

UnmarshalJSON implements NoncurrentVersionTransition JSONify

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

func (r Rule) MarshalJSON() ([]byte, error)

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

func (Tag) IsEmpty

func (tag Tag) IsEmpty() bool

IsEmpty returns whether this tag is empty or not.

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

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

func (t *Transition) UnmarshalJSON(b []byte) error

UnmarshalJSON returns an error if storage-class is empty.

Jump to

Keyboard shortcuts

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