Documentation ¶
Index ¶
- Constants
- func Errorf(format string, a ...interface{}) error
- type And
- type Config
- func (c Config) FilterActionableRules(obj ObjectOpts) []Rule
- func (c Config) FilterTargetArns(obj ObjectOpts) []string
- func (c Config) GetDestination() Destination
- func (c Config) HasActiveRules(prefix string, recursive bool) bool
- func (c Config) HasExistingObjectReplication(arn string) (hasARN, isEnabled bool)
- func (c Config) Replicate(obj ObjectOpts) bool
- func (c Config) Validate(bucket string, sameTarget bool) error
- type DeleteMarkerReplication
- type DeleteReplication
- type Destination
- func (d Destination) IsValid() bool
- func (d Destination) LegacyArn() bool
- func (d Destination) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (d Destination) String() string
- func (d Destination) TargetArn() bool
- func (d *Destination) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)
- func (d Destination) Validate(bucketName string) error
- type Error
- type ExistingObjectReplication
- type Filter
- type ObjectOpts
- type ReplicaModifications
- type Rule
- type SourceSelectionCriteria
- type Status
- type StatusType
- func (z *StatusType) DecodeMsg(dc *msgp.Reader) (err error)
- func (s StatusType) Empty() bool
- func (z StatusType) EncodeMsg(en *msgp.Writer) (err error)
- func (z StatusType) MarshalMsg(b []byte) (o []byte, err error)
- func (z StatusType) Msgsize() (s int)
- func (s StatusType) String() string
- func (z *StatusType) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Tag
- type Type
Constants ¶
const DestinationARNMinIOPrefix = "arn:minio:replication:"
DestinationARNMinIOPrefix - destination ARN prefix for MinIO.
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) FilterTargetArns ¶
func (c Config) FilterTargetArns(obj ObjectOpts) []string
FilterTargetArns returns a slice of distinct target arns in the config
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) HasExistingObjectReplication ¶
HasExistingObjectReplication returns true if any of the rule returns 'ExistingObjects' replication.
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"` ARN string }
Destination - destination in ReplicationConfiguration.
func (Destination) IsValid ¶
func (d Destination) IsValid() bool
IsValid - checks whether Destination is valid or not.
func (Destination) LegacyArn ¶
func (d Destination) LegacyArn() bool
LegacyArn returns true if arn format has prefix "arn:aws:s3:::" which was used prior to multi-destination
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) TargetArn ¶
func (d Destination) TargetArn() bool
TargetArn returns true if arn format has prefix "arn:minio:replication:::" used for multi-destination targets
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 ExistingObjectReplication ¶
type ExistingObjectReplication struct {
Status Status `xml:"Status"` // should be set to "Disabled" by default
}
ExistingObjectReplication - whether existing object replication is enabled
func (ExistingObjectReplication) IsEmpty ¶
func (e ExistingObjectReplication) IsEmpty() bool
IsEmpty returns true if ExistingObjectReplication is not set
func (*ExistingObjectReplication) UnmarshalXML ¶
func (e *ExistingObjectReplication) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)
UnmarshalXML - decodes XML data. Default to Disabled unless specified
func (ExistingObjectReplication) Validate ¶
func (e ExistingObjectReplication) Validate() error
Validate validates whether the status is disabled.
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 DeleteMarker bool SSEC bool OpType Type Replica bool ExistingObject bool TargetArn string }
ObjectOpts provides information to deduce whether replication can be triggered on the resultant object.
type ReplicaModifications ¶
type ReplicaModifications struct {
Status Status `xml:"Status" json:"Status"`
}
ReplicaModifications specifies if replica modification sync is enabled
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"` SourceSelectionCriteria SourceSelectionCriteria `xml:"SourceSelectionCriteria" json:"SourceSelectionCriteria"` Filter Filter `xml:"Filter" json:"Filter"` ExistingObjectReplication ExistingObjectReplication `xml:"ExistingObjectReplication,omitempty" json:"ExistingObjectReplication,omitempty"` }
Rule - a rule for replication configuration.
func (Rule) MetadataReplicate ¶
func (r Rule) MetadataReplicate(obj ObjectOpts) bool
MetadataReplicate returns true if object is not a replica or in the case of replicas, replica modification sync is enabled.
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 SourceSelectionCriteria ¶
type SourceSelectionCriteria struct {
ReplicaModifications ReplicaModifications `xml:"ReplicaModifications" json:"ReplicaModifications"`
}
SourceSelectionCriteria - specifies additional source selection criteria in ReplicationConfiguration.
func (SourceSelectionCriteria) IsValid ¶
func (s SourceSelectionCriteria) IsValid() bool
IsValid - checks whether SourceSelectionCriteria is valid or not.
func (SourceSelectionCriteria) MarshalXML ¶
func (s SourceSelectionCriteria) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML - encodes to XML data.
func (*SourceSelectionCriteria) UnmarshalXML ¶
func (s *SourceSelectionCriteria) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)
UnmarshalXML - decodes XML data.
func (SourceSelectionCriteria) Validate ¶
func (s SourceSelectionCriteria) Validate() error
Validate source selection criteria
type StatusType ¶
type StatusType string
StatusType of Replication for x-amz-replication-status header
const ( // Pending - replication is pending. Pending StatusType = "PENDING" // Completed - replication completed ok. Completed StatusType = "COMPLETED" // CompletedLegacy was called "COMPLETE" incorrectly. CompletedLegacy StatusType = "COMPLETE" // Failed - replication failed. Failed StatusType = "FAILED" // Replica - this is a replica. Replica StatusType = "REPLICA" )
func (*StatusType) DecodeMsg ¶
func (z *StatusType) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (StatusType) Empty ¶
func (s StatusType) Empty() bool
Empty returns true if this status is not set
func (StatusType) EncodeMsg ¶
func (z StatusType) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (StatusType) MarshalMsg ¶
func (z StatusType) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (StatusType) Msgsize ¶
func (z StatusType) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (StatusType) String ¶
func (s StatusType) String() string
String returns string representation of status
func (*StatusType) UnmarshalMsg ¶
func (z *StatusType) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
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.
type Type ¶
type Type int
Type - replication type enum
const ( UnsetReplicationType Type = 0 + iota ObjectReplicationType DeleteReplicationType MetadataReplicationType HealReplicationType ExistingObjectReplicationType ResyncReplicationType AllReplicationType )
Types of replication
func (Type) IsDataReplication ¶
IsDataReplication returns true if content being replicated