Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: logdog/client/cmd/logdog_annotee/link.go

Issue 2719183003: Annotee: Export Coordinator link generator. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: logdog/client/cmd/logdog_annotee/link.go
diff --git a/logdog/client/cmd/logdog_annotee/link.go b/logdog/client/cmd/logdog_annotee/link.go
deleted file mode 100644
index 0b61dcdb0c8408199425915b20528bb9c376967a..0000000000000000000000000000000000000000
--- a/logdog/client/cmd/logdog_annotee/link.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015 The LUCI Authors. All rights reserved.
-// Use of this source code is governed under the Apache License, Version 2.0
-// that can be found in the LICENSE file.
-
-package main
-
-import (
- "fmt"
- "net/url"
- "strings"
-
- "github.com/luci/luci-go/logdog/common/types"
- "github.com/luci/luci-go/luci_config/common/cfgtypes"
-)
-
-type coordinatorLinkGenerator struct {
- host string
- project cfgtypes.ProjectName
- prefix types.StreamName
-}
-
-func (g *coordinatorLinkGenerator) canGenerateLinks() bool {
- return (g.host != "" && g.prefix != "")
-}
-
-func (g *coordinatorLinkGenerator) GetLink(names ...types.StreamName) string {
- links := make([]string, len(names))
- for i, n := range names {
- streamName := string(g.prefix.Join(n))
- proj := g.project
- if proj == "" {
- proj = "_"
- }
- links[i] = fmt.Sprintf("s=%s", url.QueryEscape(fmt.Sprintf("%s/%s", proj, streamName)))
- }
- return fmt.Sprintf("https://%s/v/?%s", g.host, strings.Join(links, "&"))
-}

Powered by Google App Engine
This is Rietveld 408576698