lifecycle

package
v7.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 2 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,omitempty" json:"-"`
	Prefix  string   `xml:"Prefix,omitempty" json:"Prefix,omitempty"`
	Tags    []Tag    `xml:"Tag,omitempty" 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"`
}

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

func (e Expiration) IsNull() bool

IsNull returns true if both date and days fields are null

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) 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:"-"`
}

Filter will be used in selecting rule(s) for lifecycle configuration

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"`
}

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,omitempty" json:"NoncurrentDays,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) MarshalXML

func (n NoncurrentVersionTransition) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML is extended to leave out <NoncurrentVersionTransition></NoncurrentVersionTransition> tags

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

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,omitempty" json:"Days,omitempty"`
}

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 both date and days fields are null

func (Transition) MarshalXML

func (t Transition) MarshalXML(en *xml.Encoder, startElement xml.StartElement) error

MarshalXML is transition is non null

Jump to

Keyboard shortcuts

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