Chromium Code Reviews| Index: appengine/logdog/coordinator/config/config.go |
| diff --git a/appengine/logdog/coordinator/config/config.go b/appengine/logdog/coordinator/config/config.go |
| index eff6d9482e0289626cb4714f6d0c7dc4d1ef3985..e666e18dcdbc303638732db4d93ae89e265af924 100644 |
| --- a/appengine/logdog/coordinator/config/config.go |
| +++ b/appengine/logdog/coordinator/config/config.go |
| @@ -169,6 +169,23 @@ func (gcfg *GlobalConfig) LoadConfig(c context.Context) (*svcconfig.Config, erro |
| return &cc, nil |
| } |
| +// Projects lists the registered LogDog projects. |
| +func (gcfg *GlobalConfig) Projects(c context.Context) ([]string, error) { |
| + projects, err := config.Get(c).GetProjects() |
| + if err != nil { |
| + log.WithError(err).Errorf(c, "Failed to list 'luci-config' projects.") |
|
iannucci
2016/04/29 20:09:42
TODO: we'll probably want to filter by 'disabled'
dnj
2016/04/29 23:04:20
Done.
|
| + return nil, err |
| + } |
| + |
| + ids := make([]string, len(projects)) |
| + for i, p := range projects { |
| + ids[i] = p.ID |
| + } |
| + |
| + // TODO(dnj): Restrict this by actual namespaces in datastore. |
| + return ids, nil |
| +} |
| + |
| // validateConfig checks the supplied Coordinator config object to ensure that |
| // it meets a minimum configuration standard expected by our endpoitns and |
| // handlers. |