Ejemplo n.º 1
0
func main() {
	opts := auth.Options{Logger: gologger.Get()}
	application := &subcommands.DefaultApplication{
		Name:  "auth",
		Title: "Chrome Infra Authentication tool",
		Commands: []*subcommands.Command{
			subcommands.CmdHelp,
			authcli.SubcommandInfo(opts, "info"),
			authcli.SubcommandLogin(opts, "login"),
			authcli.SubcommandLogout(opts, "logout"),
		},
	}
	os.Exit(subcommands.Run(application, nil))
}
Ejemplo n.º 2
0
	"time"

	"github.com/luci/luci-go/common/logging/gologger"

	"infra/monitoring/messages"
)

const (
	maxRetries = 3
	// FYI https://github.com/golang/go/issues/9405 in Go 1.4
	// http timeout errors are logged as "use of closed network connection"
	timeout = 5 * time.Second
)

var (
	log = gologger.Get()
)

// MasterURL returns the builder URL for the given master.
func MasterURL(master string) string {
	return fmt.Sprintf("https://build.chromium.org/p/%s", master)
}

// BuilderURL returns the builder URL for the given master and builder.
func BuilderURL(master, builder string) string {
	return fmt.Sprintf("https://build.chromium.org/p/%s/builders/%s", master, oldEscape(builder))
}

// BuildURL returns the build URL for the given master, builder and build number.
func BuildURL(master, builder string, buildNum int64) string {
	return fmt.Sprintf("https://build.chromium.org/p/%s/builders/%s/builds/%d", master, oldEscape(builder), buildNum)