Rename List to ListAll

This commit is contained in:
Benedikt Kulmann
2020-04-21 09:16:53 +02:00
parent f8f9d1b7b2
commit d3412c965a
3 changed files with 4 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ func (g Service) ListSettingsBundles(c context.Context, req *proto.ListSettingsB
func listSettingsBundles(g Service, extension string) ([]*proto.SettingsBundle, error) {
if len(extension) == 0 {
return g.manager.List()
return g.manager.ListAll()
} else {
return g.manager.ListByExtension(extension)
}

View File

@@ -17,6 +17,6 @@ type RegisterFunc func(*config.Config) Manager
type Manager interface {
Read(extension string, key string) (*proto.SettingsBundle, error)
Write(bundle *proto.SettingsBundle) (*proto.SettingsBundle, error)
List() ([]*proto.SettingsBundle, error)
ListAll() ([]*proto.SettingsBundle, error)
ListByExtension(extension string) ([]*proto.SettingsBundle, error)
}

View File

@@ -45,8 +45,8 @@ func New(cfg *config.Config) settings.Manager {
return &s
}
// List returns all the bundles in the mountPath folder
func (s Store) List() ([]*proto.SettingsBundle, error) {
// ListAll returns all the bundles in the mountPath folder
func (s Store) ListAll() ([]*proto.SettingsBundle, error) {
records := []*proto.SettingsBundle{}
bundles, err := ioutil.ReadDir(s.mountPath)
if err != nil {