MCPcopy Index your code
hub / github.com/docker/cli / networkNames

Function networkNames

cli/command/system/completion.go:213–223  ·  view source on GitHub ↗

networkNames contacts the API to get a list of network names. In case of an error, an empty list is returned.

(dockerCLI completion.APIClientProvider, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

211// networkNames contacts the API to get a list of network names.
212// In case of an error, an empty list is returned.
213func networkNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string {
214 res, err := dockerCLI.Client().NetworkList(cmd.Context(), client.NetworkListOptions{})
215 if err != nil {
216 return []string{}
217 }
218 names := make([]string, 0, len(res.Items))
219 for _, nw := range res.Items {
220 names = append(names, nw.Name)
221 }
222 return names
223}
224
225// nodeNames contacts the API to get a list of node names.
226// In case of an error, an empty list is returned.

Callers 2

completeEventFiltersFunction · 0.85
completeObjectNamesFunction · 0.85

Calls 2

ClientMethod · 0.65
NetworkListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…