github.com/jfrog/jfrog-client-go@v1.40.2/pipelines/services/utils.go (about) 1 package services 2 3 import ( 4 "github.com/jfrog/jfrog-client-go/utils/errorutils" 5 "net/url" 6 ) 7 8 // constructPipelinesURL creates URL with all required details to make api call 9 // like headers, queryParams, apiPath 10 func constructPipelinesURL(qParams map[string]string, apiURL, apiPath string) (string, error) { 11 uri, err := url.Parse(apiURL + apiPath) 12 if err != nil { 13 return "", errorutils.CheckError(err) 14 } 15 queryString := uri.Query() 16 for k, v := range qParams { 17 queryString.Set(k, v) 18 } 19 uri.RawQuery = queryString.Encode() 20 21 return uri.String(), nil 22 }