func (cn *Collection) Repos() []*repository.Repository {
	repos := make([]*repository.Repository, cn.RepoCount())
	for i, ref := range cn.Refs() {
		repos[i] = cn.repos[ref]
	}
	return repos
}
Repos returns all repository structures from collection
package collection
import (
	"fmt"
	"github.com/ivanilves/lstags/repository"
	"github.com/ivanilves/lstags/tag"
)
func refHasTags(ref string, tags map[string][]*tag.Tag) bool {
	for r := range tags {
		if r == ref {
			return true
		}
	}
	return false
}
func contains(slice []string, str string) bool {
	for _, s := range slice {
		if s == str {
			return true
		}
	}
	return false
}
func New(refs []string, tags map[string][]*tag.Tag) (*Collection, error) {
	repos := make(map[string]*repository.Repository)
	for _, ref := range refs {
		repo, err := repository.ParseRef(ref)
		if err != nil {
			return nil, err
		}
		repos[ref] = repo
		if !refHasTags(ref, tags) {
			return nil, fmt.Errorf("repository reference has no tags: %s", ref)
		}
	}
	for ref := range tags {
		if !contains(refs, ref) {
			return nil, fmt.Errorf("repository has tags, but not referenced: %s", ref)
		}
	}
	return &Collection{refs: refs, repos: repos, tags: tags}, nil
}
type Collection struct {
	refs  []string
	repos map[string]*repository.Repository
	tags  map[string][]*tag.Tag
}
func (cn *Collection) Refs() []string {
	return cn.refs
}