Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OfPathByName ¶
OfPathByName returns a collection of versions of objects in a bucket that have the given path prefix, indexed by path name as a map of object paths to its generation list. If an empty string is given as a path prefix, all versions of all objects in the bucket will be returned.
Types ¶
type Version ¶
type Version struct { Key string ID string LastModified time.Time IsLatest bool IsDeleteMarker bool ETag string Size int64 }
Version represents a version or delete marker of an object in AWS
func FromAWSDeleteMarker ¶
func FromAWSDeleteMarker(marker *s3.DeleteMarkerEntry) Version
FromAWSDeleteMarker builds a Version object from a s3.DeleteMarkerEntry
func FromAWSVersion ¶
func FromAWSVersion(obj *s3.ObjectVersion) Version
FromAWSVersion builds a Version object from a s3.ObjectVersion
func (*Version) StringWithoutName ¶
StringWithoutName converts a Version to a string, omitting the name of the file. This is useful for situations where the name is implicit,
type Versions ¶
type Versions []Version
Versions represents a collection of versions
func OfPath ¶
OfPath returns a collection of versions of objects in a bucket that have the given path prefix. If an empty string is given as a path prefix, all versions of all objects in the bucket will be returned.
func (Versions) SortByLastModifiedAsc ¶
func (gs Versions) SortByLastModifiedAsc()
SortByLastModifiedAsc sorts the versions by ascending order of their creation date.
func (Versions) SortByLastModifiedDesc ¶
func (gs Versions) SortByLastModifiedDesc()
SortByLastModifiedDesc sorts the versions by descending order of their creation date.
func (Versions) SortIfNeeded ¶
SortIfNeeded sorts the collection of versions by the given sortFunc, but checks first if the list isn't already sorted by the same sortFunc. If the collection is already sorted, nothing is done.