MCPcopy
hub / github.com/cli/cli / getVariables

Function getVariables

pkg/cmd/variable/list/list.go:219–235  ·  view source on GitHub ↗
(client *http.Client, host, path string)

Source from the content-addressed store, hash-verified

217}
218
219func getVariables(client *http.Client, host, path string) ([]shared.Variable, error) {
220 var results []shared.Variable
221 apiClient := api.NewClientFromHTTP(client)
222 path = fmt.Sprintf("%s?per_page=100", path)
223 for path != "" {
224 response := struct {
225 Variables []shared.Variable
226 }{}
227 var err error
228 path, err = apiClient.RESTWithNext(host, "GET", path, nil, &response)
229 if err != nil {
230 return nil, err
231 }
232 results = append(results, response.Variables...)
233 }
234 return results, nil
235}

Callers 4

getRepoVariablesFunction · 0.85
getEnvVariablesFunction · 0.85
getOrgVariablesFunction · 0.85

Calls 2

NewClientFromHTTPFunction · 0.92
RESTWithNextMethod · 0.65

Tested by 1