| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package common | 5 package common |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "time" | 9 "time" |
| 10 | 10 |
| 11 "github.com/golang/protobuf/proto" |
| 12 "golang.org/x/net/context" |
| 13 |
| 11 "github.com/luci/gae/service/datastore" | 14 "github.com/luci/gae/service/datastore" |
| 12 "github.com/luci/gae/service/info" | 15 "github.com/luci/gae/service/info" |
| 13 "github.com/luci/luci-go/common/data/caching/proccache" | 16 "github.com/luci/luci-go/common/data/caching/proccache" |
| 14 "github.com/luci/luci-go/common/logging" | 17 "github.com/luci/luci-go/common/logging" |
| 15 "github.com/luci/luci-go/luci_config/server/cfgclient" | 18 "github.com/luci/luci-go/luci_config/server/cfgclient" |
| 16 "github.com/luci/luci-go/luci_config/server/cfgclient/backend" | 19 "github.com/luci/luci-go/luci_config/server/cfgclient/backend" |
| 17 "github.com/luci/luci-go/luci_config/server/cfgclient/textproto" | 20 "github.com/luci/luci-go/luci_config/server/cfgclient/textproto" |
| 18 "github.com/luci/luci-go/milo/common/config" | |
| 19 | 21 |
| 20 » "github.com/golang/protobuf/proto" | 22 » "github.com/luci/luci-go/milo/api/config" |
| 21 » "golang.org/x/net/context" | |
| 22 ) | 23 ) |
| 23 | 24 |
| 24 // Project is a LUCI project. | 25 // Project is a LUCI project. |
| 25 type Project struct { | 26 type Project struct { |
| 26 // The ID of the project, as per self defined. This is not the luci-con
fig | 27 // The ID of the project, as per self defined. This is not the luci-con
fig |
| 27 // name. | 28 // name. |
| 28 ID string `gae:"$id"` | 29 ID string `gae:"$id"` |
| 29 // The luci-config name of the project. | 30 // The luci-config name of the project. |
| 30 Name string | 31 Name string |
| 31 // The Project data in protobuf binary format. | 32 // The Project data in protobuf binary format. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 if err != nil { | 271 if err != nil { |
| 271 return nil, err | 272 return nil, err |
| 272 } | 273 } |
| 273 for _, cs := range p.Consoles { | 274 for _, cs := range p.Consoles { |
| 274 if cs.Name == consoleName { | 275 if cs.Name == consoleName { |
| 275 return cs, nil | 276 return cs, nil |
| 276 } | 277 } |
| 277 } | 278 } |
| 278 return nil, fmt.Errorf("Console %s not found in project %s", consoleName
, projName) | 279 return nil, fmt.Errorf("Console %s not found in project %s", consoleName
, projName) |
| 279 } | 280 } |
| OLD | NEW |