Documentation
¶
Index ¶
- Variables
- func MergeLibraryIterators(iters []borges.LibraryIterator) borges.LibraryIterator
- func MergeLocationIterators(iters []borges.LocationIterator) borges.LocationIterator
- func MergeRepositoryIterators(iters []borges.RepositoryIterator) borges.RepositoryIterator
- func RepoIterJumpLibraries(libs *Libraries, mode borges.Mode) (borges.RepositoryIterator, error)
- func RepoIterJumpLocations(libs *Libraries, mode borges.Mode) (borges.RepositoryIterator, error)
- func RepoIterJumpPlainLibraries(libs *Libraries, mode borges.Mode) (borges.RepositoryIterator, error)
- func RepoIterJumpSivaLocations(libs *Libraries, mode borges.Mode) (borges.RepositoryIterator, error)
- func RepositoryDefaultIter(l *Libraries, mode borges.Mode) (borges.RepositoryIterator, error)
- type FilterLibraryFunc
- type Libraries
- func (l *Libraries) Add(lib borges.Library) error
- func (l *Libraries) FilteredLibraries(filter FilterLibraryFunc) (borges.LibraryIterator, error)
- func (l *Libraries) Get(id borges.RepositoryID, mode borges.Mode) (borges.Repository, error)
- func (l *Libraries) GetOrInit(borges.RepositoryID) (borges.Repository, error)
- func (l *Libraries) Has(id borges.RepositoryID) (bool, borges.LibraryID, borges.LocationID, error)
- func (l *Libraries) ID() borges.LibraryID
- func (l *Libraries) Init(borges.RepositoryID) (borges.Repository, error)
- func (l *Libraries) Libraries() (borges.LibraryIterator, error)
- func (l *Libraries) Library(id borges.LibraryID) (borges.Library, error)
- func (l *Libraries) Location(id borges.LocationID) (borges.Location, error)
- func (l *Libraries) Locations() (borges.LocationIterator, error)
- func (l *Libraries) Repositories(mode borges.Mode) (borges.RepositoryIterator, error)
- type Options
- type RepositoryIterFunc
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLibraryExists an error returned when a borges.Library // added before is attempted to be added again. ErrLibraryExists = errors.NewKind("library %s already exists") )
Functions ¶
func MergeLibraryIterators ¶
func MergeLibraryIterators(iters []borges.LibraryIterator) borges.LibraryIterator
MergeLibraryIterators builds a new iterator from the given ones.
func MergeLocationIterators ¶
func MergeLocationIterators(iters []borges.LocationIterator) borges.LocationIterator
MergeLocationIterators builds a new iterator from the given ones.
func MergeRepositoryIterators ¶
func MergeRepositoryIterators(iters []borges.RepositoryIterator) borges.RepositoryIterator
MergeRepositoryIterators builds a new iterator from the given ones. The merged iterator will keep the order of the given slice of iterators to iterate them.
func RepoIterJumpLibraries ¶
RepoIterJumpLibraries returns a borges.RepositoryIterator whose order will be a returned borges.Repository from a different library each time, that is: repo from lib1, repo from lib2, repo from lib3, repo from lib1 ...
func RepoIterJumpLocations ¶
RepoIterJumpLocations returns a borges.RepositoryIterator whose order will be all the repositories from a location from a different library each time, that is: repos from loc1/lib1, repos from loc1/lib2, repos from loc2/lib1, ...
func RepoIterJumpPlainLibraries ¶
func RepoIterJumpPlainLibraries( libs *Libraries, mode borges.Mode, ) (borges.RepositoryIterator, error)
RepoIterJumpPlainLibraries returns a borges.RepositoryIterator with the same properties as the one returned by RepoIterJumpLibraries but using only those libraries of type plain.Library.
func RepoIterJumpSivaLocations ¶
func RepoIterJumpSivaLocations( libs *Libraries, mode borges.Mode, ) (borges.RepositoryIterator, error)
RepoIterJumpSivaLocations returns a borges.RepositoryIterator with the same properties as the one returned by RepoIterJumpLocations but using only those libraries of type siva.Library.
func RepositoryDefaultIter ¶
RepositoryDefaultIter returns a borges.RepositoryIterator with no specific iteration order.
Types ¶
type FilterLibraryFunc ¶
FilterLibraryFunc stands for a borges.Library filter function.
type Libraries ¶
type Libraries struct {
// contains filtered or unexported fields
}
Libraries is an implementation to aggregate borges.Library in just one instance. The borges.Library that will be added shouldn't contain other libraries inside.
func (*Libraries) Add ¶
Add adds a new borges.Library. It will fail with ErrLibraryExists if the library was already added.
func (*Libraries) FilteredLibraries ¶
func (l *Libraries) FilteredLibraries(filter FilterLibraryFunc) (borges.LibraryIterator, error)
FilteredLibraries returns an iterator containing only those libraries accomplishing with the FilteredLibraryFunc function.
func (*Libraries) ID ¶
func (l *Libraries) ID() borges.LibraryID
ID implements the Library interface.
func (*Libraries) Repositories ¶
Repositories implements the Library interface.
type Options ¶
type Options struct {
// Timeout set a timeout for library operations. Some operations could
// potentially take long so timing out them will make an error be
// returned. A 0 value sets a default value of 60 seconds.
Timeout time.Duration
RepositoryIterOrder RepositoryIterFunc
}
Options hold configuration options for a Libraries.
type RepositoryIterFunc ¶
RepositoryIterFunc stands for a function returning a borges.RepositoryIterator which iters in a certain order.