Rename List to ListAll
This commit is contained in:
@@ -52,7 +52,7 @@ func (g Service) ListSettingsBundles(c context.Context, req *proto.ListSettingsB
|
|||||||
|
|
||||||
func listSettingsBundles(g Service, extension string) ([]*proto.SettingsBundle, error) {
|
func listSettingsBundles(g Service, extension string) ([]*proto.SettingsBundle, error) {
|
||||||
if len(extension) == 0 {
|
if len(extension) == 0 {
|
||||||
return g.manager.List()
|
return g.manager.ListAll()
|
||||||
} else {
|
} else {
|
||||||
return g.manager.ListByExtension(extension)
|
return g.manager.ListByExtension(extension)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,6 @@ type RegisterFunc func(*config.Config) Manager
|
|||||||
type Manager interface {
|
type Manager interface {
|
||||||
Read(extension string, key string) (*proto.SettingsBundle, error)
|
Read(extension string, key string) (*proto.SettingsBundle, error)
|
||||||
Write(bundle *proto.SettingsBundle) (*proto.SettingsBundle, error)
|
Write(bundle *proto.SettingsBundle) (*proto.SettingsBundle, error)
|
||||||
List() ([]*proto.SettingsBundle, error)
|
ListAll() ([]*proto.SettingsBundle, error)
|
||||||
ListByExtension(extension string) ([]*proto.SettingsBundle, error)
|
ListByExtension(extension string) ([]*proto.SettingsBundle, error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ func New(cfg *config.Config) settings.Manager {
|
|||||||
return &s
|
return &s
|
||||||
}
|
}
|
||||||
|
|
||||||
// List returns all the bundles in the mountPath folder
|
// ListAll returns all the bundles in the mountPath folder
|
||||||
func (s Store) List() ([]*proto.SettingsBundle, error) {
|
func (s Store) ListAll() ([]*proto.SettingsBundle, error) {
|
||||||
records := []*proto.SettingsBundle{}
|
records := []*proto.SettingsBundle{}
|
||||||
bundles, err := ioutil.ReadDir(s.mountPath)
|
bundles, err := ioutil.ReadDir(s.mountPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user