forked from TrueCloudLab/restic
Rename ListIDs -> List
This commit is contained in:
parent
e525655dcb
commit
022f514b09
3 changed files with 3 additions and 3 deletions
|
@ -15,7 +15,7 @@ func commandList(repo *khepri.Repository, args []string) error {
|
||||||
|
|
||||||
tpe := khepri.NewTypeFromString(args[0])
|
tpe := khepri.NewTypeFromString(args[0])
|
||||||
|
|
||||||
ids, err := repo.ListIDs(tpe)
|
ids, err := repo.List(tpe)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -169,7 +169,7 @@ func (r *Repository) Remove(t Type, id ID) error {
|
||||||
type IDs []ID
|
type IDs []ID
|
||||||
|
|
||||||
// Lists all objects of a given type.
|
// Lists all objects of a given type.
|
||||||
func (r *Repository) ListIDs(t Type) (IDs, error) {
|
func (r *Repository) List(t Type) (IDs, error) {
|
||||||
// TODO: use os.Open() and d.Readdirnames() instead of Glob()
|
// TODO: use os.Open() and d.Readdirnames() instead of Glob()
|
||||||
pattern := path.Join(r.dir(t), "*")
|
pattern := path.Join(r.dir(t), "*")
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ func TestRepository(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ids, err := repo.ListIDs(tpe)
|
ids, err := repo.List(tpe)
|
||||||
ok(t, err)
|
ok(t, err)
|
||||||
|
|
||||||
sort.Sort(ids)
|
sort.Sort(ids)
|
||||||
|
|
Loading…
Reference in a new issue