Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyExportLocation ¶ added in v1.19.0
Predicate matching any export location
func FindExportLocation ¶ added in v1.19.0
func FindExportLocation(locs []shares.ExportLocation, pred ExportLocationPredicate) (index int, err error)
Searches for an export location. Returns index of an export location from the `locs` slice that satisfies following rules: 1. Location is not admin-only and is not empty 2. Location satisfies ExportLocationPredicate Search is biased: 1. Location.Preferred == true is preferred over Location.Preferred == false 2. Locations with lower index are preferred over those with higher index
Types ¶
type ExportLocationPredicate ¶ added in v1.19.0
Predicate type for filtering out export locations. It's supplied with the index into the export location slice that's being scanned. Should return (true, nil) when search conditions are satisfied, and (false, nil) when they are not.