| Index: milo/appengine/common/config.go
|
| diff --git a/milo/appengine/settings/config.go b/milo/appengine/common/config.go
|
| similarity index 90%
|
| rename from milo/appengine/settings/config.go
|
| rename to milo/appengine/common/config.go
|
| index d63598edde3e1cf0444cf2a7ecae9957bf95a7f4..9502f5872da0c81279d510ba4115f6fcb06b27bd 100644
|
| --- a/milo/appengine/settings/config.go
|
| +++ b/milo/appengine/common/config.go
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed under the Apache License, Version 2.0
|
| // that can be found in the LICENSE file.
|
|
|
| -package settings
|
| +package common
|
|
|
| import (
|
| "fmt"
|
| @@ -12,7 +12,7 @@ import (
|
| "github.com/luci/luci-go/common/logging"
|
| "github.com/luci/luci-go/luci_config/server/cfgclient"
|
| "github.com/luci/luci-go/luci_config/server/cfgclient/textproto"
|
| - milocfg "github.com/luci/luci-go/milo/common/config"
|
| + "github.com/luci/luci-go/milo/common/config"
|
| "github.com/luci/luci-go/server/router"
|
|
|
| "github.com/golang/protobuf/proto"
|
| @@ -49,7 +49,7 @@ func Update(c context.Context) error {
|
| cfgName := info.AppID(c) + ".cfg"
|
|
|
| var (
|
| - configs []*milocfg.Project
|
| + configs []*config.Project
|
| metas []*cfgclient.Meta
|
| )
|
| if err := cfgclient.Projects(c, cfgclient.AsService, cfgName, textproto.Slice(&configs), &metas); err != nil {
|
| @@ -105,7 +105,7 @@ func Update(c context.Context) error {
|
| }
|
|
|
| // GetAllProjects returns all registered projects.
|
| -func GetAllProjects(c context.Context) ([]*milocfg.Project, error) {
|
| +func GetAllProjects(c context.Context) ([]*config.Project, error) {
|
| q := ds.NewQuery("Project")
|
| q.Order("ID")
|
|
|
| @@ -114,9 +114,9 @@ func GetAllProjects(c context.Context) ([]*milocfg.Project, error) {
|
| if err != nil {
|
| return nil, err
|
| }
|
| - results := make([]*milocfg.Project, len(ps))
|
| + results := make([]*config.Project, len(ps))
|
| for i, p := range ps {
|
| - results[i] = &milocfg.Project{}
|
| + results[i] = &config.Project{}
|
| if err := proto.Unmarshal(p.Data, results[i]); err != nil {
|
| return nil, err
|
| }
|
| @@ -125,13 +125,13 @@ func GetAllProjects(c context.Context) ([]*milocfg.Project, error) {
|
| }
|
|
|
| // GetProject returns the requested project.
|
| -func GetProject(c context.Context, projName string) (*milocfg.Project, error) {
|
| +func GetProject(c context.Context, projName string) (*config.Project, error) {
|
| // Next, Try datastore
|
| p := Project{ID: projName}
|
| if err := ds.Get(c, &p); err != nil {
|
| return nil, err
|
| }
|
| - mp := milocfg.Project{}
|
| + mp := config.Project{}
|
| if err := proto.Unmarshal(p.Data, &mp); err != nil {
|
| return nil, err
|
| }
|
| @@ -140,7 +140,7 @@ func GetProject(c context.Context, projName string) (*milocfg.Project, error) {
|
| }
|
|
|
| // GetConsole returns the requested console instance.
|
| -func GetConsole(c context.Context, projName, consoleName string) (*milocfg.Console, error) {
|
| +func GetConsole(c context.Context, projName, consoleName string) (*config.Console, error) {
|
| p, err := GetProject(c, projName)
|
| if err != nil {
|
| return nil, err
|
|
|