Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OfPathByName ¶
func OfPathByName(bucket *storage.BucketHandle, path string) (map[string]Generations, error)
OfPathByName returns a collection of generations 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 generations of all objects in the bucket will be returned.
Types ¶
type Generation ¶
type Generation struct {
*storage.ObjectAttrs
}
Generation represents a generation of an object in Google Cloud Storage
func FromObjectAttrs ¶
func FromObjectAttrs(attrs *storage.ObjectAttrs) Generation
FromObjectAttrs creates a new Generation from ObjectAttrs.
type Generations ¶
type Generations []Generation
Generations represents a collection of generations
func OfBucket ¶
func OfBucket(bucket *storage.BucketHandle) (Generations, error)
OfBucket returns a collection of all generations of all objects in a bucket.
func OfPath ¶
func OfPath(bucket *storage.BucketHandle, path string) (Generations, error)
OfPath returns a collection of generations of objects in a bucket that have the given path prefix. If an empty string is given as a path prefix, all generations of all objects in the bucket will be returned.
func (Generations) SortByCreatedDateAsc ¶
func (gs Generations) SortByCreatedDateAsc()
SortByCreatedDateAsc sorts the generations by ascending order of their creation date.
func (Generations) SortByCreatedDateDesc ¶
func (gs Generations) SortByCreatedDateDesc()
SortByCreatedDateDesc sorts the generations by descending order of their creation date.
func (Generations) SortIfNeeded ¶
func (gs Generations) SortIfNeeded(sortFunc func(i, j int) bool)
SortIfNeeded sorts the collection of generations 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.