MCPcopy Create free account
hub / github.com/cli/cli / getVariables

Function getVariables

pkg/cmd/variable/list/list.go:237–254  ·  view source on GitHub ↗
(client *http.Client, host string, u *safeurl.MutableSafeURL)

Source from the content-addressed store, hash-verified

235}
236
237func getVariables(client *http.Client, host string, u *safeurl.MutableSafeURL) ([]shared.Variable, error) {
238 var results []shared.Variable
239 apiClient := api.NewClientFromHTTP(client)
240 u.SetQuery("per_page", "100")
241 var pageURL safeurl.SafeURL = u
242 for pageURL.String() != "" {
243 response := struct {
244 Variables []shared.Variable
245 }{}
246 next, err := apiClient.RESTWithNext(host, "GET", pageURL.String(), nil, &response)
247 if err != nil {
248 return nil, err
249 }
250 pageURL = safeurl.NewImmutableSafeURL(next)
251 results = append(results, response.Variables...)
252 }
253 return results, nil
254}

Callers 4

getRepoVariablesFunction · 0.85
getEnvVariablesFunction · 0.85
getOrgVariablesFunction · 0.85

Calls 5

StringMethod · 0.95
NewClientFromHTTPFunction · 0.92
NewImmutableSafeURLFunction · 0.92
SetQueryMethod · 0.80
RESTWithNextMethod · 0.65

Tested by 1