mirror of
https://github.com/gomods/athens
synced 2026-02-03 14:20:31 +00:00
showing more info on the "/all" endpoint
This commit is contained in:
@@ -4,5 +4,5 @@ package storage
|
||||
type Lister interface {
|
||||
// must return NotFoundErr if baseURL / module isn't found
|
||||
List(baseURL, module string) ([]string, error)
|
||||
All() ([]*RevInfo, error)
|
||||
All() (map[string][]*RevInfo, error)
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ func (l *Lister) List(basePath, module string) ([]string, error) {
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (l *Lister) All() ([]*storage.RevInfo, error) {
|
||||
ret := []*storage.RevInfo{}
|
||||
func (l *Lister) All() (map[string][]*storage.RevInfo, error) {
|
||||
ret := map[string][]*storage.RevInfo{}
|
||||
entries.RLock()
|
||||
defer entries.RUnlock()
|
||||
for _, versions := range entries.versions {
|
||||
for name, versions := range entries.versions {
|
||||
for _, version := range versions {
|
||||
ret = append(ret, &version.RevInfo)
|
||||
ret[name] = append(ret[name], &version.RevInfo)
|
||||
}
|
||||
}
|
||||
return ret, nil
|
||||
|
||||
Reference in New Issue
Block a user