Documentation ¶
Index ¶
Constants ¶
const DestinationARNPrefix = "arn:aws:s3:::"
DestinationARNPrefix - destination ARN prefix as per AWS S3 specification.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type And ¶
type And struct { XMLName xml.Name `xml:"And" json:"And"` Prefix string `xml:"Prefix,omitempty" json:"Prefix,omitempty"` Tags []Tag `xml:"Tag,omitempty" json:"Tag,omitempty"` }
And - a tag to combine a prefix and multiple tags for replication configuration rule.
func (And) ContainsDuplicateTag ¶
ContainsDuplicateTag - returns true if duplicate keys are present in And
type Config ¶
type Config struct { XMLName xml.Name `xml:"ReplicationConfiguration" json:"-"` Rules []Rule `xml:"Rule" json:"Rules"` // RoleArn is being reused for MinIO replication ARN RoleArn string `xml:"Role" json:"Role"` }
Config - replication configuration specified in https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html
func ParseConfig ¶
ParseConfig parses ReplicationConfiguration from xml
func (Config) FilterActionableRules ¶
func (c Config) FilterActionableRules(obj ObjectOpts) []Rule
FilterActionableRules returns the rules actions that need to be executed after evaluating prefix/tag filtering
func (Config) GetDestination ¶
func (c Config) GetDestination() Destination
GetDestination returns destination bucket and storage class.
func (Config) HasActiveRules ¶
HasActiveRules - returns whether replication policy has active rules Optionally a prefix can be supplied. If recursive is specified the function will also return true if any level below the prefix has active rules. If no prefix is specified recursive is effectively true.
func (Config) Replicate ¶
func (c Config) Replicate(obj ObjectOpts) bool
Replicate returns true if the object should be replicated.
type DeleteMarkerReplication ¶
type DeleteMarkerReplication struct {
Status Status `xml:"Status"` // should be set to "Disabled" by default
}
DeleteMarkerReplication - whether delete markers are replicated - https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html
func (DeleteMarkerReplication) IsEmpty ¶
func (d DeleteMarkerReplication) IsEmpty() bool
IsEmpty returns true if DeleteMarkerReplication is not set
func (DeleteMarkerReplication) Validate ¶
func (d DeleteMarkerReplication) Validate() error
Validate validates whether the status is disabled.
type DeleteReplication ¶
type DeleteReplication struct {
Status Status `xml:"Status"` // should be set to "Disabled" by default
}
DeleteReplication - whether versioned deletes are replicated - this is a MinIO only extension.
func (DeleteReplication) IsEmpty ¶
func (d DeleteReplication) IsEmpty() bool
IsEmpty returns true if DeleteReplication is not set
func (*DeleteReplication) UnmarshalXML ¶
func (d *DeleteReplication) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)
UnmarshalXML - decodes XML data.
func (DeleteReplication) Validate ¶
func (d DeleteReplication) Validate() error
Validate validates whether the status is disabled.
type Destination ¶
type Destination struct { XMLName xml.Name `xml:"Destination" json:"Destination"` Bucket string `xml:"Bucket" json:"Bucket"` StorageClass string `xml:"StorageClass" json:"StorageClass"` }
Destination - destination in ReplicationConfiguration.
func (Destination) IsValid ¶
func (d Destination) IsValid() bool
IsValid - checks whether Destination is valid or not.
func (Destination) MarshalXML ¶
func (d Destination) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML - encodes to XML data.
func (Destination) String ¶
func (d Destination) String() string
func (*Destination) UnmarshalXML ¶
func (d *Destination) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)
UnmarshalXML - decodes XML data.
func (Destination) Validate ¶
func (d Destination) Validate(bucketName string) error
Validate - validates Resource is for given bucket or not.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is the generic type for any error happening during tag parsing.
type Filter ¶
type Filter struct { XMLName xml.Name `xml:"Filter" json:"Filter"` Prefix string And And Tag Tag // contains filtered or unexported fields }
Filter - a filter for a replication configuration Rule.
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 ObjectOpts ¶
type ObjectOpts struct { Name string UserTags string VersionID string IsLatest bool DeleteMarker bool SSEC bool }
ObjectOpts provides information to deduce whether replication can be triggered on the resultant object.
type Rule ¶
type Rule struct { XMLName xml.Name `xml:"Rule" json:"Rule"` ID string `xml:"ID,omitempty" json:"ID,omitempty"` Status Status `xml:"Status" json:"Status"` Priority int `xml:"Priority" json:"Priority"` DeleteMarkerReplication DeleteMarkerReplication `xml:"DeleteMarkerReplication" json:"DeleteMarkerReplication"` // MinIO extension to replicate versioned deletes DeleteReplication DeleteReplication `xml:"DeleteReplication" json:"DeleteReplication"` Destination Destination `xml:"Destination" json:"Destination"` Filter Filter `xml:"Filter" json:"Filter"` }
Rule - a rule for replication configuration.
func (Rule) Prefix ¶
Prefix - a rule can either have prefix under <filter></filter> or under <filter><and></and></filter>. This method returns the prefix from the location where it is available
type StatusType ¶
type StatusType string
StatusType of Replication for x-amz-replication-status header
const ( // Pending - replication is pending. Pending StatusType = "PENDING" // Complete - replication completed ok. Complete StatusType = "COMPLETE" // Failed - replication failed. Failed StatusType = "FAILED" // Replica - this is a replica. Replica StatusType = "REPLICA" )
func (StatusType) Empty ¶
func (s StatusType) Empty() bool
Empty returns true if this status is not set
func (StatusType) String ¶
func (s StatusType) String() string
String returns string representation of status
type Tag ¶
type Tag struct { XMLName xml.Name `xml:"Tag" json:"Tag"` Key string `xml:"Key,omitempty" json:"Key,omitempty"` Value string `xml:"Value,omitempty" json:"Value,omitempty"` }
Tag - a tag for a replication configuration Rule filter.