Documentation
¶
Index ¶
- func NewDownloader[TReference, TLeaseA, TLeaseB any](backendA object.Store[TReference, TLeaseA], ...) object.Downloader[TReference]
- func NewLeaseMarshaler[TLeaseA, TLeaseB any](marshalerA leasemarshaling.LeaseMarshaler[TLeaseA], ...) leasemarshaling.LeaseMarshaler[Lease[TLeaseA, TLeaseB]]
- func NewUploader[TReference, TLeaseA, TLeaseB any](replicaA object.Store[TReference, TLeaseA], ...) object.Uploader[TReference, Lease[TLeaseA, TLeaseB]]
- type Lease
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDownloader ¶
func NewDownloader[TReference, TLeaseA, TLeaseB any](backendA object.Store[TReference, TLeaseA], backendB object.Store[TReference, TLeaseB]) object.Downloader[TReference]
NewDownloader creates a decorator for object.Downloader that attempts to read objects from two replicas.
If an object is only present in the second replicas that was queried, it is automatically copied to the first replica. This ensures that the object remains available if the second replica were to experience data loss.
func NewLeaseMarshaler ¶
func NewLeaseMarshaler[TLeaseA, TLeaseB any](marshalerA leasemarshaling.LeaseMarshaler[TLeaseA], marshalerB leasemarshaling.LeaseMarshaler[TLeaseB]) leasemarshaling.LeaseMarshaler[Lease[TLeaseA, TLeaseB]]
NewLeaseMarshaler returns a marshaler that is capable of marshaling instances of Lease. These leases are marshaled by first storing leases of both of the replicas, followed by storing the length of lease A.
func NewUploader ¶
func NewUploader[TReference, TLeaseA, TLeaseB any](replicaA object.Store[TReference, TLeaseA], replicaB object.Store[TReference, TLeaseB]) object.Uploader[TReference, Lease[TLeaseA, TLeaseB]]
NewUploader creates a decorator for object.Uploader that writes all objects to two replicas. If any inconsistencies between the backends are detected (e.g., the object is only present in one of the backends), they are repaired automatically.