Documentation
¶
Index ¶
- Variables
- type BucketLockID
- type BucketReplicationPolicy
- type BucketReplicationPolicyDestination
- type BucketReplicationPolicyID
- type BucketRoutingPolicyID
- type ConsistencyCheckID
- type ConsistencyCheckLocation
- type ConsistencyCheckObjectID
- type ConsistencyCheckReportEntry
- type ConsistencyCheckReportEntryPage
- type ConsistencyCheckSetEntry
- type ConsistencyCheckSetID
- func NewEtagConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, size uint64, etag string) ConsistencyCheckSetID
- func NewNameConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string) ConsistencyCheckSetID
- func NewSizeConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, size uint64) ConsistencyCheckSetID
- func NewVersionedEtagConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, versionIndex uint64, ...) ConsistencyCheckSetID
- func NewVersionedNameConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, versionIndex uint64) ConsistencyCheckSetID
- func NewVersionedSizeConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, versionIndex uint64, ...) ConsistencyCheckSetID
- type ConsistencyCheckSettings
- type ConsistencyCheckStatus
- type ObjectLockID
- type QueueStats
- type ReplicationStatus
- type ReplicationStatusExtended
- type ReplicationSwitchDowntimeOpts
- type ReplicationSwitchInfo
- func (s *ReplicationSwitchInfo) GetLastStartAt() (time.Time, bool)
- func (s *ReplicationSwitchInfo) IsTimeToStart() (bool, error)
- func (s *ReplicationSwitchInfo) IsZeroDowntime() bool
- func (s *ReplicationSwitchInfo) ReplicationID() UniversalReplicationID
- func (s *ReplicationSwitchInfo) SetReplicationID(id UniversalReplicationID)
- func (s *ReplicationSwitchInfo) Validate() error
- type ReplicationSwitchStatus
- type ReplicationSwitchZeroDowntimeOpts
- type UniversalReplicationID
- func (r *UniversalReplicationID) AsBucketID() (BucketReplicationPolicy, bool)
- func (r *UniversalReplicationID) AsString() string
- func (r *UniversalReplicationID) AsUserID() (UserReplicationPolicy, bool)
- func (r *UniversalReplicationID) FromStorage() string
- func (r *UniversalReplicationID) FromToBuckets(taskBucket string) (from, to string)
- func (r *UniversalReplicationID) IsEmpty() bool
- func (r UniversalReplicationID) MarshalJSON() ([]byte, error)
- func (r *UniversalReplicationID) Swap() UniversalReplicationID
- func (r *UniversalReplicationID) ToStorage() string
- func (r *UniversalReplicationID) UnmarshalJSON(data []byte) error
- func (r *UniversalReplicationID) User() string
- func (r *UniversalReplicationID) Validate() error
- type UserReplicationPolicy
- type VersionedObjectID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TimeNow is a function to get current time // it is a variable so that it can be mocked in tests TimeNow = time.Now )
Functions ¶
This section is empty.
Types ¶
type BucketLockID ¶
func NewBucketLockID ¶
func NewBucketLockID(storage string, bucket string) BucketLockID
type BucketReplicationPolicy ¶
type BucketReplicationPolicy struct {
User string
FromStorage string
FromBucket string
ToStorage string
ToBucket string
}
func (BucketReplicationPolicy) Destination ¶
func (p BucketReplicationPolicy) Destination() BucketReplicationPolicyDestination
func (BucketReplicationPolicy) LookupID ¶
func (p BucketReplicationPolicy) LookupID() BucketReplicationPolicyID
func (BucketReplicationPolicy) RoutingID ¶
func (p BucketReplicationPolicy) RoutingID() BucketRoutingPolicyID
func (BucketReplicationPolicy) Validate ¶
func (p BucketReplicationPolicy) Validate() error
type BucketReplicationPolicyID ¶
func NewBucketReplicationPolicyID ¶
func NewBucketReplicationPolicyID(user string, fromBucket string) BucketReplicationPolicyID
type BucketRoutingPolicyID ¶
func NewBucketRoutingPolicyID ¶
func NewBucketRoutingPolicyID(user string, bucket string) BucketRoutingPolicyID
type ConsistencyCheckID ¶
type ConsistencyCheckID struct {
Locations []ConsistencyCheckLocation
}
func NewConsistencyCheckID ¶
func NewConsistencyCheckID(locations ...ConsistencyCheckLocation) ConsistencyCheckID
type ConsistencyCheckLocation ¶
func NewConsistencyCheckLocation ¶
func NewConsistencyCheckLocation(storage string, bucket string) ConsistencyCheckLocation
type ConsistencyCheckObjectID ¶
type ConsistencyCheckObjectID struct {
Storage string
Prefix string
ConsistencyCheckID ConsistencyCheckID
}
func NewConsistencyCheckObjectID ¶
func NewConsistencyCheckObjectID(consistencyCheckID ConsistencyCheckID, storage string, prefix string) ConsistencyCheckObjectID
type ConsistencyCheckReportEntry ¶
type ConsistencyCheckReportEntry struct {
Object string
Etag string
StorageEntries []ConsistencyCheckSetEntry
Size uint64
VersionIndex uint64
}
func NewConsistencyCheckReportEntry ¶
func NewConsistencyCheckReportEntry(object string, versionIndex uint64, size uint64, etag string, storageEntries []ConsistencyCheckSetEntry) ConsistencyCheckReportEntry
type ConsistencyCheckReportEntryPage ¶
type ConsistencyCheckReportEntryPage struct {
Entries []ConsistencyCheckReportEntry
Cursor uint64
}
func NewConsistencyCheckReportEntryPage ¶
func NewConsistencyCheckReportEntryPage(entries []ConsistencyCheckReportEntry, cursor uint64) ConsistencyCheckReportEntryPage
type ConsistencyCheckSetEntry ¶
type ConsistencyCheckSetEntry struct {
Location ConsistencyCheckLocation
VersionID string
}
func NewConsistencyCheckSetEntry ¶
func NewConsistencyCheckSetEntry(location ConsistencyCheckLocation) ConsistencyCheckSetEntry
func NewVersionedConsistencyCheckSetEntry ¶
func NewVersionedConsistencyCheckSetEntry(location ConsistencyCheckLocation, versionID string) ConsistencyCheckSetEntry
type ConsistencyCheckSetID ¶
type ConsistencyCheckSetID struct {
Object string
Etag string
ConsistencyCheckID ConsistencyCheckID
Size uint64
VersionIndex uint64
}
func NewEtagConsistencyCheckSetID ¶
func NewEtagConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, size uint64, etag string) ConsistencyCheckSetID
func NewNameConsistencyCheckSetID ¶
func NewNameConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string) ConsistencyCheckSetID
func NewSizeConsistencyCheckSetID ¶
func NewSizeConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, size uint64) ConsistencyCheckSetID
func NewVersionedEtagConsistencyCheckSetID ¶
func NewVersionedEtagConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, versionIndex uint64, size uint64, etag string) ConsistencyCheckSetID
func NewVersionedNameConsistencyCheckSetID ¶
func NewVersionedNameConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, versionIndex uint64) ConsistencyCheckSetID
func NewVersionedSizeConsistencyCheckSetID ¶
func NewVersionedSizeConsistencyCheckSetID(consistencyCheckID ConsistencyCheckID, object string, versionIndex uint64, size uint64) ConsistencyCheckSetID
type ConsistencyCheckSettings ¶
func NewConsistencyCheckSettings ¶
func NewConsistencyCheckSettings(versioned bool, withSize bool, withEtag bool) ConsistencyCheckSettings
type ConsistencyCheckStatus ¶
type ConsistencyCheckStatus struct {
Locations []ConsistencyCheckLocation
Queued uint64
Completed uint64
Ready bool
Consistent bool
ConsistencyCheckSettings
}
type ObjectLockID ¶
func NewObjectLockID ¶
func NewObjectLockID(storage string, bucket string, name string) ObjectLockID
func NewVersionedObjectLockID ¶
func NewVersionedObjectLockID(storage string, bucket string, name string, version string) ObjectLockID
type QueueStats ¶
type QueueStats struct {
// Number of tasks left. Includes, new, in_progress, and retried tasks.
Unprocessed int
// Total number of successfully processed tasks.
Done int
// Age of the oldest pending task in the queue.
Latency time.Duration
// Approx bytes used by the queue and its tasks in Redis.
MemoryUsage int64
}
type ReplicationStatus ¶
type ReplicationStatusExtended ¶
type ReplicationStatusExtended struct {
*ReplicationStatus
Switch *ReplicationSwitchInfo `redis:"-"`
// True if at least one of the queues is paused.
IsPaused bool
// Aggregated stats for initial migration queues.
InitMigration QueueStats
// Aggregated stats for event migration queues.
EventMigration QueueStats
}
func (*ReplicationStatusExtended) InitDone ¶
func (r *ReplicationStatusExtended) InitDone() bool
type ReplicationSwitchDowntimeOpts ¶
type ReplicationSwitchDowntimeOpts struct {
Cron *string `redis:"cron,omitempty"`
StartAt *time.Time `redis:"startAt,omitempty"`
MaxEventLag *uint32 `redis:"maxEventLag,omitempty"`
MaxDuration time.Duration `redis:"maxDuration,omitempty"`
StartOnInitDone bool `redis:"onInitDone"`
SkipBucketCheck bool `redis:"skipBucketCheck,omitempty"`
ContinueReplication bool `redis:"continueReplication,omitempty"`
}
func (*ReplicationSwitchDowntimeOpts) GetCron ¶
func (w *ReplicationSwitchDowntimeOpts) GetCron() (string, bool)
func (*ReplicationSwitchDowntimeOpts) GetMaxDuration ¶
func (w *ReplicationSwitchDowntimeOpts) GetMaxDuration() (time.Duration, bool)
func (*ReplicationSwitchDowntimeOpts) GetMaxEventLag ¶
func (w *ReplicationSwitchDowntimeOpts) GetMaxEventLag() (uint32, bool)
func (*ReplicationSwitchDowntimeOpts) GetStartAt ¶
func (w *ReplicationSwitchDowntimeOpts) GetStartAt() (time.Time, bool)
type ReplicationSwitchInfo ¶
type ReplicationSwitchInfo struct {
// Time of switch creation
CreatedAt time.Time `redis:"createdAt"`
// Time of last switch was in progress
LastStartedAt *time.Time `redis:"startedAt,omitempty"`
// Time of last switch was done
DoneAt *time.Time `redis:"doneAt,omitempty"`
// Options for downtime switch
ReplicationSwitchDowntimeOpts
// ID of replication policy of this switch
ReplicationIDStr string `redis:"replicationID"`
// Last status of switch
LastStatus ReplicationSwitchStatus `redis:"lastStatus,omitempty"`
// History of switch status changes
History []string `redis:"-"`
// Options for zero downtime switch
ReplicationSwitchZeroDowntimeOpts
}
Contains all information about replication switch including its configuration and current status.
func (*ReplicationSwitchInfo) GetLastStartAt ¶
func (s *ReplicationSwitchInfo) GetLastStartAt() (time.Time, bool)
func (*ReplicationSwitchInfo) IsTimeToStart ¶
func (s *ReplicationSwitchInfo) IsTimeToStart() (bool, error)
func (*ReplicationSwitchInfo) IsZeroDowntime ¶
func (s *ReplicationSwitchInfo) IsZeroDowntime() bool
func (*ReplicationSwitchInfo) ReplicationID ¶
func (s *ReplicationSwitchInfo) ReplicationID() UniversalReplicationID
func (*ReplicationSwitchInfo) SetReplicationID ¶
func (s *ReplicationSwitchInfo) SetReplicationID(id UniversalReplicationID)
func (*ReplicationSwitchInfo) Validate ¶
func (s *ReplicationSwitchInfo) Validate() error
type ReplicationSwitchStatus ¶
type ReplicationSwitchStatus string
const ( // StatusNotStarted means that switch donwntime is not started yet // Relevant only for downtime switches StatusNotStarted ReplicationSwitchStatus = "not_started" // StatusInProgress means that downtime is started, bucket is blocked until task queue is drained or timeout StatusInProgress ReplicationSwitchStatus = "in_progress" // StatusCheckInProgress means that task queue is drained and bucket is blocked until src and dst bucket contents will be checked // Relevant only for downtime switches StatusCheckInProgress ReplicationSwitchStatus = "check_in_progress" // StatusDone means that switch is successfully finished and data is routed to new bucket. StatusDone ReplicationSwitchStatus = "done" // StatusError means that switch was aborted due to error // Relevant only for downtime switches StatusError ReplicationSwitchStatus = "error" // StatusSkipped means that switch attempt was skipped because conditions were not met // Relevant only for downtime switches StatusSkipped ReplicationSwitchStatus = "skipped" )
func (ReplicationSwitchStatus) MarshalBinary ¶
func (s ReplicationSwitchStatus) MarshalBinary() (data []byte, err error)
func (*ReplicationSwitchStatus) UnmarshalBinary ¶
func (s *ReplicationSwitchStatus) UnmarshalBinary(data []byte) error
type UniversalReplicationID ¶
type UniversalReplicationID struct {
// contains filtered or unexported fields
}
func UniversalFromBucketReplication ¶
func UniversalFromBucketReplication(id BucketReplicationPolicy) UniversalReplicationID
func UniversalFromUserReplication ¶
func UniversalFromUserReplication(policy UserReplicationPolicy) UniversalReplicationID
func UniversalIDFromString ¶
func UniversalIDFromString(s string) (UniversalReplicationID, error)
func (*UniversalReplicationID) AsBucketID ¶
func (r *UniversalReplicationID) AsBucketID() (BucketReplicationPolicy, bool)
func (*UniversalReplicationID) AsString ¶
func (r *UniversalReplicationID) AsString() string
func (*UniversalReplicationID) AsUserID ¶
func (r *UniversalReplicationID) AsUserID() (UserReplicationPolicy, bool)
func (*UniversalReplicationID) FromStorage ¶
func (r *UniversalReplicationID) FromStorage() string
func (*UniversalReplicationID) FromToBuckets ¶
func (r *UniversalReplicationID) FromToBuckets(taskBucket string) (from, to string)
func (*UniversalReplicationID) IsEmpty ¶
func (r *UniversalReplicationID) IsEmpty() bool
func (UniversalReplicationID) MarshalJSON ¶
func (r UniversalReplicationID) MarshalJSON() ([]byte, error)
func (*UniversalReplicationID) Swap ¶
func (r *UniversalReplicationID) Swap() UniversalReplicationID
Returns a new UniversalReplicationID with swapped source and destination
func (*UniversalReplicationID) ToStorage ¶
func (r *UniversalReplicationID) ToStorage() string
func (*UniversalReplicationID) UnmarshalJSON ¶
func (r *UniversalReplicationID) UnmarshalJSON(data []byte) error
func (*UniversalReplicationID) User ¶
func (r *UniversalReplicationID) User() string
func (*UniversalReplicationID) Validate ¶
func (r *UniversalReplicationID) Validate() error
type UserReplicationPolicy ¶
func NewUserReplicationPolicy ¶
func NewUserReplicationPolicy(user string, fromStorage string, toStorage string) UserReplicationPolicy
func (UserReplicationPolicy) LookupID ¶
func (p UserReplicationPolicy) LookupID() string
func (UserReplicationPolicy) RoutingID ¶
func (p UserReplicationPolicy) RoutingID() string
func (UserReplicationPolicy) Validate ¶
func (p UserReplicationPolicy) Validate() error
type VersionedObjectID ¶
func NewVersionedObjectID ¶
func NewVersionedObjectID(storage string, bucket string, name string) VersionedObjectID
Click to show internal directories.
Click to hide internal directories.