| 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 viewer is a support library to interact with the LogDog web app and | 5 // Package viewer is a support library to interact with the LogDog web app and |
| 6 // log stream viewer. | 6 // log stream viewer. |
| 7 package viewer | 7 package viewer |
| 8 | 8 |
| 9 import ( | 9 import ( |
| 10 "fmt" | 10 "fmt" |
| 11 "net/url" | 11 "net/url" |
| 12 | 12 |
| 13 "github.com/luci/luci-go/common/config" | |
| 14 "github.com/luci/luci-go/logdog/common/types" | 13 "github.com/luci/luci-go/logdog/common/types" |
| 14 "github.com/luci/luci-go/luci_config/common/cfgtypes" |
| 15 ) | 15 ) |
| 16 | 16 |
| 17 // GetURL generates a LogDog app viewer URL for the specified streams. | 17 // GetURL generates a LogDog app viewer URL for the specified streams. |
| 18 func GetURL(host string, project config.ProjectName, paths ...types.StreamPath)
string { | 18 func GetURL(host string, project cfgtypes.ProjectName, paths ...types.StreamPath
) string { |
| 19 values := make([]string, len(paths)) | 19 values := make([]string, len(paths)) |
| 20 for i, p := range paths { | 20 for i, p := range paths { |
| 21 values[i] = fmt.Sprintf("%s/%s", project, p) | 21 values[i] = fmt.Sprintf("%s/%s", project, p) |
| 22 } | 22 } |
| 23 u := url.URL{ | 23 u := url.URL{ |
| 24 Scheme: "https", | 24 Scheme: "https", |
| 25 Host: host, | 25 Host: host, |
| 26 Path: "v/", | 26 Path: "v/", |
| 27 RawQuery: url.Values{ | 27 RawQuery: url.Values{ |
| 28 "s": values, | 28 "s": values, |
| 29 }.Encode(), | 29 }.Encode(), |
| 30 } | 30 } |
| 31 return u.String() | 31 return u.String() |
| 32 } | 32 } |
| OLD | NEW |