| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 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 main implements the LogDog Coordinator validation binary. This simply | 5 // Package main implements the LogDog Coordinator validation binary. This simply |
| 6 // loads configuration from a text protobuf and verifies that it works. | 6 // loads configuration from a text protobuf and verifies that it works. |
| 7 package main | 7 package main |
| 8 | 8 |
| 9 import ( | 9 import ( |
| 10 "flag" | 10 "flag" |
| 11 "fmt" | 11 "fmt" |
| 12 "io/ioutil" | 12 "io/ioutil" |
| 13 "log" | 13 "log" |
| 14 "os" | 14 "os" |
| 15 | 15 |
| 16 "github.com/maruel/subcommands" | 16 "github.com/maruel/subcommands" |
| 17 | 17 |
| 18 "github.com/golang/protobuf/proto" | 18 "github.com/golang/protobuf/proto" |
| 19 "github.com/luci/go-render/render" | 19 "github.com/luci/go-render/render" |
| 20 "github.com/luci/luci-go/common/cli" | 20 "github.com/luci/luci-go/common/cli" |
| 21 "github.com/luci/luci-go/logdog/api/config/svcconfig" | 21 "github.com/luci/luci-go/logdog/api/config/svcconfig" |
| 22 ) | 22 ) |
| 23 | 23 |
| 24 var ( | 24 var ( |
| 25 subcommandValidateServices = subcommands.Command{ | 25 subcommandValidateServices = subcommands.Command{ |
| 26 UsageLine: "services", | 26 UsageLine: "services", |
| 27 » » ShortDesc: fmt.Sprintf("Validate %q services config file.", svcc
onfig.ServiceConfigFilename), | 27 » » ShortDesc: fmt.Sprintf("Validate %q services config file.", svcc
onfig.ServiceConfigPath), |
| 28 CommandRun: func() subcommands.CommandRun { | 28 CommandRun: func() subcommands.CommandRun { |
| 29 return &validateCommandRun{msg: &svcconfig.Config{}} | 29 return &validateCommandRun{msg: &svcconfig.Config{}} |
| 30 }, | 30 }, |
| 31 } | 31 } |
| 32 | 32 |
| 33 subcommandValidateProject = subcommands.Command{ | 33 subcommandValidateProject = subcommands.Command{ |
| 34 UsageLine: "project", | 34 UsageLine: "project", |
| 35 ShortDesc: "Validate project config file.", | 35 ShortDesc: "Validate project config file.", |
| 36 CommandRun: func() subcommands.CommandRun { | 36 CommandRun: func() subcommands.CommandRun { |
| 37 return &validateCommandRun{msg: &svcconfig.ProjectConfig
{}} | 37 return &validateCommandRun{msg: &svcconfig.ProjectConfig
{}} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 Commands: []*subcommands.Command{ | 70 Commands: []*subcommands.Command{ |
| 71 subcommands.CmdHelp, | 71 subcommands.CmdHelp, |
| 72 &subcommandValidateServices, | 72 &subcommandValidateServices, |
| 73 &subcommandValidateProject, | 73 &subcommandValidateProject, |
| 74 }, | 74 }, |
| 75 } | 75 } |
| 76 | 76 |
| 77 flag.Parse() | 77 flag.Parse() |
| 78 os.Exit(subcommands.Run(&app, flag.Args())) | 78 os.Exit(subcommands.Run(&app, flag.Args())) |
| 79 } | 79 } |
| OLD | NEW |