From a6762a38a8dbee5547b7bf1b42a22700ccc4bcbb Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Fri, 9 Aug 2019 15:05:44 -0400 Subject: [PATCH] Making the monocular client search path a const Signed-off-by: Matt Farina --- internal/monocular/search.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/monocular/search.go b/internal/monocular/search.go index 3f448394c..feadf93df 100644 --- a/internal/monocular/search.go +++ b/internal/monocular/search.go @@ -28,6 +28,9 @@ import ( "helm.sh/helm/pkg/chart" ) +// SearchPath is the url path to the search API in monocular. +const SearchPath = "api/chartsvc/v1/charts/search" + // The structs below represent the structure of the response from the monocular // search API. The structs were not imported from monocular because monocular // imports from Helm v2 (avoiding circular version dependency) and the mappings @@ -100,7 +103,7 @@ func (c *Client) Search(term string) ([]SearchResult, error) { } // Set the path to the monocular API endpoint for search - p.Path = path.Join(p.Path, "api/chartsvc/v1/charts/search") + p.Path = path.Join(p.Path, SearchPath) p.RawQuery = "q=" + url.QueryEscape(term)