repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
partition
stringclasses
1 value
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
UnmarshalJSON
func (space *Space) UnmarshalJSON(data []byte) error { var ccSpace struct { Metadata internal.Metadata `json:"metadata"` Entity struct { Name string `json:"name"` AllowSSH bool `json:"allow_ssh"` SpaceQuotaDefinitionGUID string `json:"space_quota_definition_guid"` ...
go
func (space *Space) UnmarshalJSON(data []byte) error { var ccSpace struct { Metadata internal.Metadata `json:"metadata"` Entity struct { Name string `json:"name"` AllowSSH bool `json:"allow_ssh"` SpaceQuotaDefinitionGUID string `json:"space_quota_definition_guid"` ...
[ "func", "(", "space", "*", "Space", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "ccSpace", "struct", "{", "Metadata", "internal", ".", "Metadata", "`json:\"metadata\"`", "\n", "Entity", "struct", "{", "Name", "string", "`...
// UnmarshalJSON helps unmarshal a Cloud Controller Space response.
[ "UnmarshalJSON", "helps", "unmarshal", "a", "Cloud", "Controller", "Space", "response", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L34-L55
train
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
CreateSpace
func (client *Client) CreateSpace(spaceName string, orgGUID string) (Space, Warnings, error) { requestBody := createSpaceRequestBody{ Name: spaceName, OrganizationGUID: orgGUID, } bodyBytes, _ := json.Marshal(requestBody) request, err := client.newHTTPRequest(requestOptions{ RequestName: interna...
go
func (client *Client) CreateSpace(spaceName string, orgGUID string) (Space, Warnings, error) { requestBody := createSpaceRequestBody{ Name: spaceName, OrganizationGUID: orgGUID, } bodyBytes, _ := json.Marshal(requestBody) request, err := client.newHTTPRequest(requestOptions{ RequestName: interna...
[ "func", "(", "client", "*", "Client", ")", "CreateSpace", "(", "spaceName", "string", ",", "orgGUID", "string", ")", "(", "Space", ",", "Warnings", ",", "error", ")", "{", "requestBody", ":=", "createSpaceRequestBody", "{", "Name", ":", "spaceName", ",", "...
// CreateSpace creates a new space with the provided spaceName in the org with // the provided orgGUID.
[ "CreateSpace", "creates", "a", "new", "space", "with", "the", "provided", "spaceName", "in", "the", "org", "with", "the", "provided", "orgGUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L64-L89
train
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
DeleteSpace
func (client *Client) DeleteSpace(guid string) (Job, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteSpaceRequest, URIParams: Params{"space_guid": guid}, Query: url.Values{ "recursive": {"true"}, "async": {"true"}, }, }) if err != nil { retur...
go
func (client *Client) DeleteSpace(guid string) (Job, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteSpaceRequest, URIParams: Params{"space_guid": guid}, Query: url.Values{ "recursive": {"true"}, "async": {"true"}, }, }) if err != nil { retur...
[ "func", "(", "client", "*", "Client", ")", "DeleteSpace", "(", "guid", "string", ")", "(", "Job", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ":", "inte...
// DeleteSpace deletes the Space associated with the provided // GUID. It will return the Cloud Controller job that is assigned to the // Space deletion.
[ "DeleteSpace", "deletes", "the", "Space", "associated", "with", "the", "provided", "GUID", ".", "It", "will", "return", "the", "Cloud", "Controller", "job", "that", "is", "assigned", "to", "the", "Space", "deletion", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L94-L114
train
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
GetSecurityGroupSpaces
func (client *Client) GetSecurityGroupSpaces(securityGroupGUID string) ([]Space, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSecurityGroupSpacesRequest, URIParams: map[string]string{"security_group_guid": securityGroupGUID}, }) if err != nil { return nil,...
go
func (client *Client) GetSecurityGroupSpaces(securityGroupGUID string) ([]Space, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSecurityGroupSpacesRequest, URIParams: map[string]string{"security_group_guid": securityGroupGUID}, }) if err != nil { return nil,...
[ "func", "(", "client", "*", "Client", ")", "GetSecurityGroupSpaces", "(", "securityGroupGUID", "string", ")", "(", "[", "]", "Space", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions"...
// GetSecurityGroupSpaces returns a list of Spaces based on the provided // SecurityGroup GUID.
[ "GetSecurityGroupSpaces", "returns", "a", "list", "of", "Spaces", "based", "on", "the", "provided", "SecurityGroup", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L118-L141
train
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
GetSpaces
func (client *Client) GetSpaces(filters ...Filter) ([]Space, Warnings, error) { params := ConvertFilterParameters(filters) params.Add("order-by", "name") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSpacesRequest, Query: params, }) if err != nil { return nil, nil, err ...
go
func (client *Client) GetSpaces(filters ...Filter) ([]Space, Warnings, error) { params := ConvertFilterParameters(filters) params.Add("order-by", "name") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSpacesRequest, Query: params, }) if err != nil { return nil, nil, err ...
[ "func", "(", "client", "*", "Client", ")", "GetSpaces", "(", "filters", "...", "Filter", ")", "(", "[", "]", "Space", ",", "Warnings", ",", "error", ")", "{", "params", ":=", "ConvertFilterParameters", "(", "filters", ")", "\n", "params", ".", "Add", "...
// GetSpaces returns a list of Spaces based off of the provided filters.
[ "GetSpaces", "returns", "a", "list", "of", "Spaces", "based", "off", "of", "the", "provided", "filters", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L171-L196
train
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
UpdateSpaceDeveloper
func (client *Client) UpdateSpaceDeveloper(spaceGUID string, uaaID string) (Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PutSpaceDeveloperRequest, URIParams: map[string]string{ "space_guid": spaceGUID, "developer_guid": uaaID, }, }) if err != nil { ...
go
func (client *Client) UpdateSpaceDeveloper(spaceGUID string, uaaID string) (Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PutSpaceDeveloperRequest, URIParams: map[string]string{ "space_guid": spaceGUID, "developer_guid": uaaID, }, }) if err != nil { ...
[ "func", "(", "client", "*", "Client", ")", "UpdateSpaceDeveloper", "(", "spaceGUID", "string", ",", "uaaID", "string", ")", "(", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "...
// UpdateSpaceDeveloper grants the space developer role to the user or client // associated with the given UAA ID.
[ "UpdateSpaceDeveloper", "grants", "the", "space", "developer", "role", "to", "the", "user", "or", "client", "associated", "with", "the", "given", "UAA", "ID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L200-L215
train
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
UpdateSpaceManagerByUsername
func (client *Client) UpdateSpaceManagerByUsername(spaceGUID string, username string) (Warnings, error) { requestBody := updateRoleRequestBody{ Username: username, } bodyBytes, err := json.Marshal(requestBody) if err != nil { return Warnings{}, err } request, err := client.newHTTPRequest(requestOptions{ Re...
go
func (client *Client) UpdateSpaceManagerByUsername(spaceGUID string, username string) (Warnings, error) { requestBody := updateRoleRequestBody{ Username: username, } bodyBytes, err := json.Marshal(requestBody) if err != nil { return Warnings{}, err } request, err := client.newHTTPRequest(requestOptions{ Re...
[ "func", "(", "client", "*", "Client", ")", "UpdateSpaceManagerByUsername", "(", "spaceGUID", "string", ",", "username", "string", ")", "(", "Warnings", ",", "error", ")", "{", "requestBody", ":=", "updateRoleRequestBody", "{", "Username", ":", "username", ",", ...
// UpdateSpaceManagerByUsername grants the given username the space manager role.
[ "UpdateSpaceManagerByUsername", "grants", "the", "given", "username", "the", "space", "manager", "role", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L267-L291
train
cloudfoundry/cli
api/uaa/info.go
NewInfo
func NewInfo(link string) Info { var info Info info.Links.Login = link info.Links.UAA = link return info }
go
func NewInfo(link string) Info { var info Info info.Links.Login = link info.Links.UAA = link return info }
[ "func", "NewInfo", "(", "link", "string", ")", "Info", "{", "var", "info", "Info", "\n", "info", ".", "Links", ".", "Login", "=", "link", "\n", "info", ".", "Links", ".", "UAA", "=", "link", "\n", "return", "info", "\n", "}" ]
// NewInfo returns back a new
[ "NewInfo", "returns", "back", "a", "new" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/info.go#L35-L40
train
cloudfoundry/cli
api/cloudcontroller/ccv2/service_key.go
CreateServiceKey
func (client *Client) CreateServiceKey(serviceInstanceGUID string, keyName string, parameters map[string]interface{}) (ServiceKey, Warnings, error) { requestBody := serviceKeyRequestBody{ ServiceInstanceGUID: serviceInstanceGUID, Name: keyName, Parameters: parameters, } bodyBytes, err ...
go
func (client *Client) CreateServiceKey(serviceInstanceGUID string, keyName string, parameters map[string]interface{}) (ServiceKey, Warnings, error) { requestBody := serviceKeyRequestBody{ ServiceInstanceGUID: serviceInstanceGUID, Name: keyName, Parameters: parameters, } bodyBytes, err ...
[ "func", "(", "client", "*", "Client", ")", "CreateServiceKey", "(", "serviceInstanceGUID", "string", ",", "keyName", "string", ",", "parameters", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "ServiceKey", ",", "Warnings", ",", "error", ")", ...
// CreateServiceKey creates a new service key using the provided name and // parameters for the requested service instance.
[ "CreateServiceKey", "creates", "a", "new", "service", "key", "using", "the", "provided", "name", "and", "parameters", "for", "the", "requested", "service", "instance", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_key.go#L56-L83
train
cloudfoundry/cli
actor/pluginaction/install.go
DownloadExecutableBinaryFromURL
func (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error) { tempFile, err := makeTempFile(tempPluginDir) if err != nil { return "", err } err = actor.client.DownloadPlugin(pluginURL, tempFile.Name(), proxyReader) if err != nil { ...
go
func (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error) { tempFile, err := makeTempFile(tempPluginDir) if err != nil { return "", err } err = actor.client.DownloadPlugin(pluginURL, tempFile.Name(), proxyReader) if err != nil { ...
[ "func", "(", "actor", "Actor", ")", "DownloadExecutableBinaryFromURL", "(", "pluginURL", "string", ",", "tempPluginDir", "string", ",", "proxyReader", "plugin", ".", "ProxyReader", ")", "(", "string", ",", "error", ")", "{", "tempFile", ",", "err", ":=", "make...
// DownloadExecutableBinaryFromURL fetches a plugin binary from the specified // URL, if it exists.
[ "DownloadExecutableBinaryFromURL", "fetches", "a", "plugin", "binary", "from", "the", "specified", "URL", "if", "it", "exists", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/install.go#L63-L75
train
cloudfoundry/cli
actor/pluginaction/install.go
FileExists
func (actor Actor) FileExists(path string) bool { _, err := os.Stat(path) return err == nil }
go
func (actor Actor) FileExists(path string) bool { _, err := os.Stat(path) return err == nil }
[ "func", "(", "actor", "Actor", ")", "FileExists", "(", "path", "string", ")", "bool", "{", "_", ",", "err", ":=", "os", ".", "Stat", "(", "path", ")", "\n", "return", "err", "==", "nil", "\n", "}" ]
// FileExists returns true if the file exists. It returns false if the file // doesn't exist or there is an error checking.
[ "FileExists", "returns", "true", "if", "the", "file", "exists", ".", "It", "returns", "false", "if", "the", "file", "doesn", "t", "exist", "or", "there", "is", "an", "error", "checking", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/install.go#L79-L82
train
cloudfoundry/cli
util/configv3/plugins_config.go
PluginCommands
func (p Plugin) PluginCommands() []PluginCommand { sort.Slice(p.Commands, func(i, j int) bool { return strings.ToLower(p.Commands[i].Name) < strings.ToLower(p.Commands[j].Name) }) return p.Commands }
go
func (p Plugin) PluginCommands() []PluginCommand { sort.Slice(p.Commands, func(i, j int) bool { return strings.ToLower(p.Commands[i].Name) < strings.ToLower(p.Commands[j].Name) }) return p.Commands }
[ "func", "(", "p", "Plugin", ")", "PluginCommands", "(", ")", "[", "]", "PluginCommand", "{", "sort", ".", "Slice", "(", "p", ".", "Commands", ",", "func", "(", "i", ",", "j", "int", ")", "bool", "{", "return", "strings", ".", "ToLower", "(", "p", ...
// PluginCommands returns the plugin's commands sorted by command name.
[ "PluginCommands", "returns", "the", "plugin", "s", "commands", "sorted", "by", "command", "name", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L43-L48
train
cloudfoundry/cli
util/configv3/plugins_config.go
String
func (v PluginVersion) String() string { if v.Major == 0 && v.Minor == 0 && v.Build == 0 { return notApplicable } return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Build) }
go
func (v PluginVersion) String() string { if v.Major == 0 && v.Minor == 0 && v.Build == 0 { return notApplicable } return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Build) }
[ "func", "(", "v", "PluginVersion", ")", "String", "(", ")", "string", "{", "if", "v", ".", "Major", "==", "0", "&&", "v", ".", "Minor", "==", "0", "&&", "v", ".", "Build", "==", "0", "{", "return", "notApplicable", "\n", "}", "\n", "return", "fmt...
// String returns the plugin's version in the format x.y.z.
[ "String", "returns", "the", "plugin", "s", "version", "in", "the", "format", "x", ".", "y", ".", "z", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L58-L63
train
cloudfoundry/cli
util/configv3/plugins_config.go
CommandName
func (c PluginCommand) CommandName() string { if c.Name != "" && c.Alias != "" { return fmt.Sprintf("%s, %s", c.Name, c.Alias) } return c.Name }
go
func (c PluginCommand) CommandName() string { if c.Name != "" && c.Alias != "" { return fmt.Sprintf("%s, %s", c.Name, c.Alias) } return c.Name }
[ "func", "(", "c", "PluginCommand", ")", "CommandName", "(", ")", "string", "{", "if", "c", ".", "Name", "!=", "\"", "\"", "&&", "c", ".", "Alias", "!=", "\"", "\"", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "c", ".", "Name", "...
// CommandName returns the name of the plugin. The name is concatenated with // alias if alias is specified.
[ "CommandName", "returns", "the", "name", "of", "the", "plugin", ".", "The", "name", "is", "concatenated", "with", "alias", "if", "alias", "is", "specified", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L75-L80
train
cloudfoundry/cli
util/configv3/plugins_config.go
AddPlugin
func (config *Config) AddPlugin(plugin Plugin) { config.pluginsConfig.Plugins[plugin.Name] = plugin }
go
func (config *Config) AddPlugin(plugin Plugin) { config.pluginsConfig.Plugins[plugin.Name] = plugin }
[ "func", "(", "config", "*", "Config", ")", "AddPlugin", "(", "plugin", "Plugin", ")", "{", "config", ".", "pluginsConfig", ".", "Plugins", "[", "plugin", ".", "Name", "]", "=", "plugin", "\n", "}" ]
// AddPlugin adds the specified plugin to PluginsConfig
[ "AddPlugin", "adds", "the", "specified", "plugin", "to", "PluginsConfig" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L89-L91
train
cloudfoundry/cli
util/configv3/plugins_config.go
GetPlugin
func (config *Config) GetPlugin(pluginName string) (Plugin, bool) { plugin, exists := config.pluginsConfig.Plugins[pluginName] return plugin, exists }
go
func (config *Config) GetPlugin(pluginName string) (Plugin, bool) { plugin, exists := config.pluginsConfig.Plugins[pluginName] return plugin, exists }
[ "func", "(", "config", "*", "Config", ")", "GetPlugin", "(", "pluginName", "string", ")", "(", "Plugin", ",", "bool", ")", "{", "plugin", ",", "exists", ":=", "config", ".", "pluginsConfig", ".", "Plugins", "[", "pluginName", "]", "\n", "return", "plugin...
// GetPlugin returns the requested plugin and true if it exists.
[ "GetPlugin", "returns", "the", "requested", "plugin", "and", "true", "if", "it", "exists", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L98-L101
train
cloudfoundry/cli
util/configv3/plugins_config.go
GetPluginCaseInsensitive
func (config *Config) GetPluginCaseInsensitive(pluginName string) (Plugin, bool) { for name, plugin := range config.pluginsConfig.Plugins { if strings.EqualFold(name, pluginName) { return plugin, true } } return Plugin{}, false }
go
func (config *Config) GetPluginCaseInsensitive(pluginName string) (Plugin, bool) { for name, plugin := range config.pluginsConfig.Plugins { if strings.EqualFold(name, pluginName) { return plugin, true } } return Plugin{}, false }
[ "func", "(", "config", "*", "Config", ")", "GetPluginCaseInsensitive", "(", "pluginName", "string", ")", "(", "Plugin", ",", "bool", ")", "{", "for", "name", ",", "plugin", ":=", "range", "config", ".", "pluginsConfig", ".", "Plugins", "{", "if", "strings"...
// GetPluginCaseInsensitive finds the first matching plugin name case // insensitive and returns true if it exists.
[ "GetPluginCaseInsensitive", "finds", "the", "first", "matching", "plugin", "name", "case", "insensitive", "and", "returns", "true", "if", "it", "exists", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L105-L113
train
cloudfoundry/cli
util/configv3/plugins_config.go
RemovePlugin
func (config *Config) RemovePlugin(pluginName string) { delete(config.pluginsConfig.Plugins, pluginName) }
go
func (config *Config) RemovePlugin(pluginName string) { delete(config.pluginsConfig.Plugins, pluginName) }
[ "func", "(", "config", "*", "Config", ")", "RemovePlugin", "(", "pluginName", "string", ")", "{", "delete", "(", "config", ".", "pluginsConfig", ".", "Plugins", ",", "pluginName", ")", "\n", "}" ]
// RemovePlugin removes the specified plugin from PluginsConfig idempotently
[ "RemovePlugin", "removes", "the", "specified", "plugin", "from", "PluginsConfig", "idempotently" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L139-L141
train
cloudfoundry/cli
util/configv3/plugins_config.go
WritePluginConfig
func (config *Config) WritePluginConfig() error { // Marshal JSON rawConfig, err := json.MarshalIndent(config.pluginsConfig, "", " ") if err != nil { return err } pluginFileDir := filepath.Join(config.PluginHome()) err = os.MkdirAll(pluginFileDir, 0700) if err != nil { return err } // Write to file ret...
go
func (config *Config) WritePluginConfig() error { // Marshal JSON rawConfig, err := json.MarshalIndent(config.pluginsConfig, "", " ") if err != nil { return err } pluginFileDir := filepath.Join(config.PluginHome()) err = os.MkdirAll(pluginFileDir, 0700) if err != nil { return err } // Write to file ret...
[ "func", "(", "config", "*", "Config", ")", "WritePluginConfig", "(", ")", "error", "{", "// Marshal JSON", "rawConfig", ",", "err", ":=", "json", ".", "MarshalIndent", "(", "config", ".", "pluginsConfig", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "if"...
// WritePluginConfig writes the plugin config to config.json in the plugin home // directory.
[ "WritePluginConfig", "writes", "the", "plugin", "config", "to", "config", ".", "json", "in", "the", "plugin", "home", "directory", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L145-L160
train
cloudfoundry/cli
actor/pluginaction/actor.go
NewActor
func NewActor(config Config, client PluginClient) *Actor { return &Actor{config: config, client: client} }
go
func NewActor(config Config, client PluginClient) *Actor { return &Actor{config: config, client: client} }
[ "func", "NewActor", "(", "config", "Config", ",", "client", "PluginClient", ")", "*", "Actor", "{", "return", "&", "Actor", "{", "config", ":", "config", ",", "client", ":", "client", "}", "\n", "}" ]
// NewActor returns a pluginaction Actor
[ "NewActor", "returns", "a", "pluginaction", "Actor" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/actor.go#L11-L13
train
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
DeleteService
func (client *Client) DeleteService(serviceGUID string, purge bool) (Warnings, error) { queryParams := url.Values{} queryParams.Set("purge", strconv.FormatBool(purge)) queryParams.Set("async", "true") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteServiceRequest, Query: ...
go
func (client *Client) DeleteService(serviceGUID string, purge bool) (Warnings, error) { queryParams := url.Values{} queryParams.Set("purge", strconv.FormatBool(purge)) queryParams.Set("async", "true") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteServiceRequest, Query: ...
[ "func", "(", "client", "*", "Client", ")", "DeleteService", "(", "serviceGUID", "string", ",", "purge", "bool", ")", "(", "Warnings", ",", "error", ")", "{", "queryParams", ":=", "url", ".", "Values", "{", "}", "\n", "queryParams", ".", "Set", "(", "\"...
// DeleteService deletes the service with the given GUID, and returns any errors and warnings.
[ "DeleteService", "deletes", "the", "service", "with", "the", "given", "GUID", "and", "returns", "any", "errors", "and", "warnings", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L31-L49
train
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
UnmarshalJSON
func (service *Service) UnmarshalJSON(data []byte) error { var ccService struct { Metadata internal.Metadata Entity struct { Label string `json:"label"` Description string `json:"description"` DocumentationURL string `json:"documentation_url"` ServiceBrokerName string `json:"servic...
go
func (service *Service) UnmarshalJSON(data []byte) error { var ccService struct { Metadata internal.Metadata Entity struct { Label string `json:"label"` Description string `json:"description"` DocumentationURL string `json:"documentation_url"` ServiceBrokerName string `json:"servic...
[ "func", "(", "service", "*", "Service", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "ccService", "struct", "{", "Metadata", "internal", ".", "Metadata", "\n", "Entity", "struct", "{", "Label", "string", "`json:\"label\"`", ...
// UnmarshalJSON helps unmarshal a Cloud Controller Service response.
[ "UnmarshalJSON", "helps", "unmarshal", "a", "Cloud", "Controller", "Service", "response", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L52-L93
train
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
GetService
func (client *Client) GetService(serviceGUID string) (Service, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceRequest, URIParams: Params{"service_guid": serviceGUID}, }) if err != nil { return Service{}, nil, err } var service Service response := ...
go
func (client *Client) GetService(serviceGUID string) (Service, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceRequest, URIParams: Params{"service_guid": serviceGUID}, }) if err != nil { return Service{}, nil, err } var service Service response := ...
[ "func", "(", "client", "*", "Client", ")", "GetService", "(", "serviceGUID", "string", ")", "(", "Service", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ":...
// GetService returns the service with the given GUID.
[ "GetService", "returns", "the", "service", "with", "the", "given", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L96-L112
train
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
GetServices
func (client *Client) GetServices(filters ...Filter) ([]Service, Warnings, error) { opts := requestOptions{ RequestName: internal.GetServicesRequest, Query: ConvertFilterParameters(filters), } return client.makeServicesRequest(opts) }
go
func (client *Client) GetServices(filters ...Filter) ([]Service, Warnings, error) { opts := requestOptions{ RequestName: internal.GetServicesRequest, Query: ConvertFilterParameters(filters), } return client.makeServicesRequest(opts) }
[ "func", "(", "client", "*", "Client", ")", "GetServices", "(", "filters", "...", "Filter", ")", "(", "[", "]", "Service", ",", "Warnings", ",", "error", ")", "{", "opts", ":=", "requestOptions", "{", "RequestName", ":", "internal", ".", "GetServicesRequest...
// GetServices returns a list of Services given the provided filters.
[ "GetServices", "returns", "a", "list", "of", "Services", "given", "the", "provided", "filters", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L115-L122
train
cloudfoundry/cli
actor/v2action/service_plan_visibility.go
GetServicePlanVisibilities
func (actor *Actor) GetServicePlanVisibilities(planGUID string) ([]ServicePlanVisibility, Warnings, error) { visibilities, warnings, err := actor.CloudControllerClient.GetServicePlanVisibilities(ccv2.Filter{ Type: constant.ServicePlanGUIDFilter, Operator: constant.EqualOperator, Values: []string{planGUID},...
go
func (actor *Actor) GetServicePlanVisibilities(planGUID string) ([]ServicePlanVisibility, Warnings, error) { visibilities, warnings, err := actor.CloudControllerClient.GetServicePlanVisibilities(ccv2.Filter{ Type: constant.ServicePlanGUIDFilter, Operator: constant.EqualOperator, Values: []string{planGUID},...
[ "func", "(", "actor", "*", "Actor", ")", "GetServicePlanVisibilities", "(", "planGUID", "string", ")", "(", "[", "]", "ServicePlanVisibility", ",", "Warnings", ",", "error", ")", "{", "visibilities", ",", "warnings", ",", "err", ":=", "actor", ".", "CloudCon...
// GetServicePlanVisibilities fetches service plan visibilities for a plan by GUID.
[ "GetServicePlanVisibilities", "fetches", "service", "plan", "visibilities", "for", "a", "plan", "by", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_plan_visibility.go#L11-L27
train
cloudfoundry/cli
api/cloudcontroller/ccv3/internal/routing.go
CreatePath
func (r Route) CreatePath(params Params) (string, error) { components := strings.Split(r.Path, "/") for i, c := range components { if len(c) == 0 { continue } if c[0] == ':' { val, ok := params[c[1:]] if !ok { return "", fmt.Errorf("missing param %s", c) } components[i] = val } } u, err ...
go
func (r Route) CreatePath(params Params) (string, error) { components := strings.Split(r.Path, "/") for i, c := range components { if len(c) == 0 { continue } if c[0] == ':' { val, ok := params[c[1:]] if !ok { return "", fmt.Errorf("missing param %s", c) } components[i] = val } } u, err ...
[ "func", "(", "r", "Route", ")", "CreatePath", "(", "params", "Params", ")", "(", "string", ",", "error", ")", "{", "components", ":=", "strings", ".", "Split", "(", "r", ".", "Path", ",", "\"", "\"", ")", "\n", "for", "i", ",", "c", ":=", "range"...
// CreatePath combines the route's path pattern with a Params map // to produce a valid path.
[ "CreatePath", "combines", "the", "route", "s", "path", "pattern", "with", "a", "Params", "map", "to", "produce", "a", "valid", "path", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/internal/routing.go#L73-L93
train
cloudfoundry/cli
api/cloudcontroller/ccv3/internal/routing.go
NewRouter
func NewRouter(routes []Route, resources map[string]string) *Router { mappedRoutes := map[string]Route{} for _, route := range routes { mappedRoutes[route.Name] = route } return &Router{ routes: mappedRoutes, resources: resources, } }
go
func NewRouter(routes []Route, resources map[string]string) *Router { mappedRoutes := map[string]Route{} for _, route := range routes { mappedRoutes[route.Name] = route } return &Router{ routes: mappedRoutes, resources: resources, } }
[ "func", "NewRouter", "(", "routes", "[", "]", "Route", ",", "resources", "map", "[", "string", "]", "string", ")", "*", "Router", "{", "mappedRoutes", ":=", "map", "[", "string", "]", "Route", "{", "}", "\n", "for", "_", ",", "route", ":=", "range", ...
// NewRouter returns a pointer to a new Router.
[ "NewRouter", "returns", "a", "pointer", "to", "a", "new", "Router", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/internal/routing.go#L103-L112
train
cloudfoundry/cli
api/cloudcontroller/ccv3/internal/routing.go
CreateRequest
func (router Router) CreateRequest(name string, params Params, body io.Reader) (*http.Request, error) { route, ok := router.routes[name] if !ok { return &http.Request{}, fmt.Errorf("no route exists with the name %s", name) } uri, err := route.CreatePath(params) if err != nil { return &http.Request{}, err } ...
go
func (router Router) CreateRequest(name string, params Params, body io.Reader) (*http.Request, error) { route, ok := router.routes[name] if !ok { return &http.Request{}, fmt.Errorf("no route exists with the name %s", name) } uri, err := route.CreatePath(params) if err != nil { return &http.Request{}, err } ...
[ "func", "(", "router", "Router", ")", "CreateRequest", "(", "name", "string", ",", "params", "Params", ",", "body", "io", ".", "Reader", ")", "(", "*", "http", ".", "Request", ",", "error", ")", "{", "route", ",", "ok", ":=", "router", ".", "routes",...
// CreateRequest returns a request key'd off of the name given. The params are // merged into the URL and body is set as the request body.
[ "CreateRequest", "returns", "a", "request", "key", "d", "off", "of", "the", "name", "given", ".", "The", "params", "are", "merged", "into", "the", "URL", "and", "body", "is", "set", "as", "the", "request", "body", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/internal/routing.go#L116-L138
train
cloudfoundry/cli
api/uaa/client.go
NewClient
func NewClient(config Config) *Client { userAgent := fmt.Sprintf("%s/%s (%s; %s %s)", config.BinaryName(), config.BinaryVersion(), runtime.Version(), runtime.GOARCH, runtime.GOOS, ) client := Client{ config: config, connection: NewConnection(config.SkipSSLValidation(), config.UAADisableKeepAlives(), ...
go
func NewClient(config Config) *Client { userAgent := fmt.Sprintf("%s/%s (%s; %s %s)", config.BinaryName(), config.BinaryVersion(), runtime.Version(), runtime.GOARCH, runtime.GOOS, ) client := Client{ config: config, connection: NewConnection(config.SkipSSLValidation(), config.UAADisableKeepAlives(), ...
[ "func", "NewClient", "(", "config", "Config", ")", "*", "Client", "{", "userAgent", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "config", ".", "BinaryName", "(", ")", ",", "config", ".", "BinaryVersion", "(", ")", ",", "runtime", ".", "Version",...
// NewClient returns a new UAA Client with the provided configuration
[ "NewClient", "returns", "a", "new", "UAA", "Client", "with", "the", "provided", "configuration" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/client.go#L27-L45
train
cloudfoundry/cli
util/ui/ui.go
NewUI
func NewUI(config Config) (*UI, error) { translateFunc, err := GetTranslationFunc(config) if err != nil { return nil, err } location := time.Now().Location() return &UI{ In: os.Stdin, Out: color.Output, OutForInteration: os.Stdout, Err: os.Stderr, colorEnabled:...
go
func NewUI(config Config) (*UI, error) { translateFunc, err := GetTranslationFunc(config) if err != nil { return nil, err } location := time.Now().Location() return &UI{ In: os.Stdin, Out: color.Output, OutForInteration: os.Stdout, Err: os.Stderr, colorEnabled:...
[ "func", "NewUI", "(", "config", "Config", ")", "(", "*", "UI", ",", "error", ")", "{", "translateFunc", ",", "err", ":=", "GetTranslationFunc", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", ...
// NewUI will return a UI object where Out is set to STDOUT, In is set to // STDIN, and Err is set to STDERR
[ "NewUI", "will", "return", "a", "UI", "object", "where", "Out", "is", "set", "to", "STDOUT", "In", "is", "set", "to", "STDIN", "and", "Err", "is", "set", "to", "STDERR" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L99-L122
train
cloudfoundry/cli
util/ui/ui.go
DisplayError
func (ui *UI) DisplayError(err error) { var errMsg string if translatableError, ok := err.(translatableerror.TranslatableError); ok { errMsg = translatableError.Translate(ui.translate) } else { errMsg = err.Error() } fmt.Fprintf(ui.Err, "%s\n", errMsg) ui.terminalLock.Lock() defer ui.terminalLock.Unlock() ...
go
func (ui *UI) DisplayError(err error) { var errMsg string if translatableError, ok := err.(translatableerror.TranslatableError); ok { errMsg = translatableError.Translate(ui.translate) } else { errMsg = err.Error() } fmt.Fprintf(ui.Err, "%s\n", errMsg) ui.terminalLock.Lock() defer ui.terminalLock.Unlock() ...
[ "func", "(", "ui", "*", "UI", ")", "DisplayError", "(", "err", "error", ")", "{", "var", "errMsg", "string", "\n", "if", "translatableError", ",", "ok", ":=", "err", ".", "(", "translatableerror", ".", "TranslatableError", ")", ";", "ok", "{", "errMsg", ...
// DisplayError outputs the translated error message to ui.Err if the error // satisfies TranslatableError, otherwise it outputs the original error message // to ui.Err. It also outputs "FAILED" in bold red to ui.Out.
[ "DisplayError", "outputs", "the", "translated", "error", "message", "to", "ui", ".", "Err", "if", "the", "error", "satisfies", "TranslatableError", "otherwise", "it", "outputs", "the", "original", "error", "message", "to", "ui", ".", "Err", ".", "It", "also", ...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L157-L170
train
cloudfoundry/cli
util/ui/ui.go
DisplayHeader
func (ui *UI) DisplayHeader(text string) { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "%s\n", ui.modifyColor(ui.TranslateText(text), color.New(color.Bold))) }
go
func (ui *UI) DisplayHeader(text string) { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "%s\n", ui.modifyColor(ui.TranslateText(text), color.New(color.Bold))) }
[ "func", "(", "ui", "*", "UI", ")", "DisplayHeader", "(", "text", "string", ")", "{", "ui", ".", "terminalLock", ".", "Lock", "(", ")", "\n", "defer", "ui", ".", "terminalLock", ".", "Unlock", "(", ")", "\n\n", "fmt", ".", "Fprintf", "(", "ui", ".",...
// DisplayHeader translates the header, bolds and adds the default color to the // header, and outputs the result to ui.Out.
[ "DisplayHeader", "translates", "the", "header", "bolds", "and", "adds", "the", "default", "color", "to", "the", "header", "and", "outputs", "the", "result", "to", "ui", ".", "Out", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L181-L186
train
cloudfoundry/cli
util/ui/ui.go
DisplayNewline
func (ui *UI) DisplayNewline() { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "\n") }
go
func (ui *UI) DisplayNewline() { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "\n") }
[ "func", "(", "ui", "*", "UI", ")", "DisplayNewline", "(", ")", "{", "ui", ".", "terminalLock", ".", "Lock", "(", ")", "\n", "defer", "ui", ".", "terminalLock", ".", "Unlock", "(", ")", "\n\n", "fmt", ".", "Fprintf", "(", "ui", ".", "Out", ",", "\...
// DisplayNewline outputs a newline to UI.Out.
[ "DisplayNewline", "outputs", "a", "newline", "to", "UI", ".", "Out", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L189-L194
train
cloudfoundry/cli
util/ui/ui.go
DisplayOK
func (ui *UI) DisplayOK() { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "%s\n\n", ui.modifyColor(ui.TranslateText("OK"), color.New(color.FgGreen, color.Bold))) }
go
func (ui *UI) DisplayOK() { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "%s\n\n", ui.modifyColor(ui.TranslateText("OK"), color.New(color.FgGreen, color.Bold))) }
[ "func", "(", "ui", "*", "UI", ")", "DisplayOK", "(", ")", "{", "ui", ".", "terminalLock", ".", "Lock", "(", ")", "\n", "defer", "ui", ".", "terminalLock", ".", "Unlock", "(", ")", "\n\n", "fmt", ".", "Fprintf", "(", "ui", ".", "Out", ",", "\"", ...
// DisplayOK outputs a bold green translated "OK" to UI.Out.
[ "DisplayOK", "outputs", "a", "bold", "green", "translated", "OK", "to", "UI", ".", "Out", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L197-L202
train
cloudfoundry/cli
util/ui/ui.go
DisplayText
func (ui *UI) DisplayText(template string, templateValues ...map[string]interface{}) { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "%s\n", ui.TranslateText(template, templateValues...)) }
go
func (ui *UI) DisplayText(template string, templateValues ...map[string]interface{}) { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() fmt.Fprintf(ui.Out, "%s\n", ui.TranslateText(template, templateValues...)) }
[ "func", "(", "ui", "*", "UI", ")", "DisplayText", "(", "template", "string", ",", "templateValues", "...", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "ui", ".", "terminalLock", ".", "Lock", "(", ")", "\n", "defer", "ui", ".", "termin...
// DisplayText translates the template, substitutes in templateValues, and // outputs the result to ui.Out. Only the first map in templateValues is used.
[ "DisplayText", "translates", "the", "template", "substitutes", "in", "templateValues", "and", "outputs", "the", "result", "to", "ui", ".", "Out", ".", "Only", "the", "first", "map", "in", "templateValues", "is", "used", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L206-L211
train
cloudfoundry/cli
util/ui/ui.go
DisplayTextWithFlavor
func (ui *UI) DisplayTextWithFlavor(template string, templateValues ...map[string]interface{}) { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() firstTemplateValues := getFirstSet(templateValues) for key, value := range firstTemplateValues { firstTemplateValues[key] = ui.modifyColor(fmt.Sprint(value), colo...
go
func (ui *UI) DisplayTextWithFlavor(template string, templateValues ...map[string]interface{}) { ui.terminalLock.Lock() defer ui.terminalLock.Unlock() firstTemplateValues := getFirstSet(templateValues) for key, value := range firstTemplateValues { firstTemplateValues[key] = ui.modifyColor(fmt.Sprint(value), colo...
[ "func", "(", "ui", "*", "UI", ")", "DisplayTextWithFlavor", "(", "template", "string", ",", "templateValues", "...", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "ui", ".", "terminalLock", ".", "Lock", "(", ")", "\n", "defer", "ui", ".",...
// DisplayTextWithFlavor translates the template, bolds and adds cyan color to // templateValues, substitutes templateValues into the template, and outputs // the result to ui.Out. Only the first map in templateValues is used.
[ "DisplayTextWithFlavor", "translates", "the", "template", "bolds", "and", "adds", "cyan", "color", "to", "templateValues", "substitutes", "templateValues", "into", "the", "template", "and", "outputs", "the", "result", "to", "ui", ".", "Out", ".", "Only", "the", ...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L230-L239
train
cloudfoundry/cli
util/ui/ui.go
DisplayWarning
func (ui *UI) DisplayWarning(template string, templateValues ...map[string]interface{}) { fmt.Fprintf(ui.Err, "%s\n\n", ui.TranslateText(template, templateValues...)) }
go
func (ui *UI) DisplayWarning(template string, templateValues ...map[string]interface{}) { fmt.Fprintf(ui.Err, "%s\n\n", ui.TranslateText(template, templateValues...)) }
[ "func", "(", "ui", "*", "UI", ")", "DisplayWarning", "(", "template", "string", ",", "templateValues", "...", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "fmt", ".", "Fprintf", "(", "ui", ".", "Err", ",", "\"", "\\n", "\\n", "\"", "...
// DisplayWarning translates the warning, substitutes in templateValues, and // outputs to ui.Err. Only the first map in templateValues is used.
[ "DisplayWarning", "translates", "the", "warning", "substitutes", "in", "templateValues", "and", "outputs", "to", "ui", ".", "Err", ".", "Only", "the", "first", "map", "in", "templateValues", "is", "used", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L243-L245
train
cloudfoundry/cli
util/ui/ui.go
DisplayWarnings
func (ui *UI) DisplayWarnings(warnings []string) { for _, warning := range warnings { fmt.Fprintf(ui.Err, "%s\n", ui.TranslateText(warning)) } if len(warnings) > 0 { fmt.Fprintln(ui.Err) } }
go
func (ui *UI) DisplayWarnings(warnings []string) { for _, warning := range warnings { fmt.Fprintf(ui.Err, "%s\n", ui.TranslateText(warning)) } if len(warnings) > 0 { fmt.Fprintln(ui.Err) } }
[ "func", "(", "ui", "*", "UI", ")", "DisplayWarnings", "(", "warnings", "[", "]", "string", ")", "{", "for", "_", ",", "warning", ":=", "range", "warnings", "{", "fmt", ".", "Fprintf", "(", "ui", ".", "Err", ",", "\"", "\\n", "\"", ",", "ui", ".",...
// DisplayWarnings translates the warnings and outputs to ui.Err.
[ "DisplayWarnings", "translates", "the", "warnings", "and", "outputs", "to", "ui", ".", "Err", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L248-L255
train
cloudfoundry/cli
util/ui/ui.go
TranslateText
func (ui *UI) TranslateText(template string, templateValues ...map[string]interface{}) string { return ui.translate(template, getFirstSet(templateValues)) }
go
func (ui *UI) TranslateText(template string, templateValues ...map[string]interface{}) string { return ui.translate(template, getFirstSet(templateValues)) }
[ "func", "(", "ui", "*", "UI", ")", "TranslateText", "(", "template", "string", ",", "templateValues", "...", "map", "[", "string", "]", "interface", "{", "}", ")", "string", "{", "return", "ui", ".", "translate", "(", "template", ",", "getFirstSet", "(",...
// TranslateText passes the template through an internationalization function // to translate it to a pre-configured language, and returns the template with // templateValues substituted in. Only the first map in templateValues is used.
[ "TranslateText", "passes", "the", "template", "through", "an", "internationalization", "function", "to", "translate", "it", "to", "a", "pre", "-", "configured", "language", "and", "returns", "the", "template", "with", "templateValues", "substituted", "in", ".", "O...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L275-L277
train
cloudfoundry/cli
util/ui/ui.go
UserFriendlyDate
func (ui *UI) UserFriendlyDate(input time.Time) string { return input.Local().Format("Mon 02 Jan 15:04:05 MST 2006") }
go
func (ui *UI) UserFriendlyDate(input time.Time) string { return input.Local().Format("Mon 02 Jan 15:04:05 MST 2006") }
[ "func", "(", "ui", "*", "UI", ")", "UserFriendlyDate", "(", "input", "time", ".", "Time", ")", "string", "{", "return", "input", ".", "Local", "(", ")", ".", "Format", "(", "\"", "\"", ")", "\n", "}" ]
// UserFriendlyDate converts the time to UTC and then formats it to ISO8601.
[ "UserFriendlyDate", "converts", "the", "time", "to", "UTC", "and", "then", "formats", "it", "to", "ISO8601", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui.go#L280-L282
train
cloudfoundry/cli
util/configv3/plugin_repository.go
AddPluginRepository
func (config *Config) AddPluginRepository(name string, url string) { config.ConfigFile.PluginRepositories = append(config.ConfigFile.PluginRepositories, PluginRepository{Name: name, URL: url}) }
go
func (config *Config) AddPluginRepository(name string, url string) { config.ConfigFile.PluginRepositories = append(config.ConfigFile.PluginRepositories, PluginRepository{Name: name, URL: url}) }
[ "func", "(", "config", "*", "Config", ")", "AddPluginRepository", "(", "name", "string", ",", "url", "string", ")", "{", "config", ".", "ConfigFile", ".", "PluginRepositories", "=", "append", "(", "config", ".", "ConfigFile", ".", "PluginRepositories", ",", ...
// AddPluginRepository adds an new repository to the plugin config. It does not // add duplicates to the config.
[ "AddPluginRepository", "adds", "an", "new", "repository", "to", "the", "plugin", "config", ".", "It", "does", "not", "add", "duplicates", "to", "the", "config", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugin_repository.go#L24-L27
train
cloudfoundry/cli
util/ui/ui_for_push.go
DisplayChangesForPush
func (ui *UI) DisplayChangesForPush(changeSet []Change) error { if len(changeSet) == 0 { return nil } var columnWidth int for _, change := range changeSet { if width := wordSize(ui.TranslateText(change.Header)); width > columnWidth { columnWidth = width } } for _, change := range changeSet { padding ...
go
func (ui *UI) DisplayChangesForPush(changeSet []Change) error { if len(changeSet) == 0 { return nil } var columnWidth int for _, change := range changeSet { if width := wordSize(ui.TranslateText(change.Header)); width > columnWidth { columnWidth = width } } for _, change := range changeSet { padding ...
[ "func", "(", "ui", "*", "UI", ")", "DisplayChangesForPush", "(", "changeSet", "[", "]", "Change", ")", "error", "{", "if", "len", "(", "changeSet", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", "var", "columnWidth", "int", "\n", "for", "_"...
// DisplayChangesForPush will display the set of changes via // DisplayChangeForPush in the order given.
[ "DisplayChangesForPush", "will", "display", "the", "set", "of", "changes", "via", "DisplayChangeForPush", "in", "the", "order", "given", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/ui_for_push.go#L73-L94
train
cloudfoundry/cli
actor/v2action/service_instance.go
CreateServiceInstance
func (actor Actor) CreateServiceInstance(spaceGUID, serviceName, servicePlanName, serviceInstanceName, brokerName string, params map[string]interface{}, tags []string) (ServiceInstance, Warnings, error) { var allWarnings Warnings plan, allWarnings, err := actor.getServicePlanForServiceInSpace(servicePlanName, service...
go
func (actor Actor) CreateServiceInstance(spaceGUID, serviceName, servicePlanName, serviceInstanceName, brokerName string, params map[string]interface{}, tags []string) (ServiceInstance, Warnings, error) { var allWarnings Warnings plan, allWarnings, err := actor.getServicePlanForServiceInSpace(servicePlanName, service...
[ "func", "(", "actor", "Actor", ")", "CreateServiceInstance", "(", "spaceGUID", ",", "serviceName", ",", "servicePlanName", ",", "serviceInstanceName", ",", "brokerName", "string", ",", "params", "map", "[", "string", "]", "interface", "{", "}", ",", "tags", "[...
// CreateServiceInstance creates a new service instance with the provided attributes.
[ "CreateServiceInstance", "creates", "a", "new", "service", "instance", "with", "the", "provided", "attributes", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_instance.go#L14-L29
train
cloudfoundry/cli
actor/v2action/route.go
Summary
func (rs Routes) Summary() string { formattedRoutes := []string{} for _, route := range rs { formattedRoutes = append(formattedRoutes, route.String()) } return strings.Join(formattedRoutes, ", ") }
go
func (rs Routes) Summary() string { formattedRoutes := []string{} for _, route := range rs { formattedRoutes = append(formattedRoutes, route.String()) } return strings.Join(formattedRoutes, ", ") }
[ "func", "(", "rs", "Routes", ")", "Summary", "(", ")", "string", "{", "formattedRoutes", ":=", "[", "]", "string", "{", "}", "\n", "for", "_", ",", "route", ":=", "range", "rs", "{", "formattedRoutes", "=", "append", "(", "formattedRoutes", ",", "route...
// Summary converts routes into a comma separated string.
[ "Summary", "converts", "routes", "into", "a", "comma", "separated", "string", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L19-L25
train
cloudfoundry/cli
actor/v2action/route.go
Validate
func (r Route) Validate() error { if r.Domain.IsHTTP() { if r.Port.IsSet { return actionerror.InvalidHTTPRouteSettings{Domain: r.Domain.Name} } if r.Domain.IsShared() && r.Host == "" { return actionerror.NoHostnameAndSharedDomainError{} } } else { // Is TCP Domain if r.Host != "" || r.Path != "" { ...
go
func (r Route) Validate() error { if r.Domain.IsHTTP() { if r.Port.IsSet { return actionerror.InvalidHTTPRouteSettings{Domain: r.Domain.Name} } if r.Domain.IsShared() && r.Host == "" { return actionerror.NoHostnameAndSharedDomainError{} } } else { // Is TCP Domain if r.Host != "" || r.Path != "" { ...
[ "func", "(", "r", "Route", ")", "Validate", "(", ")", "error", "{", "if", "r", ".", "Domain", ".", "IsHTTP", "(", ")", "{", "if", "r", ".", "Port", ".", "IsSet", "{", "return", "actionerror", ".", "InvalidHTTPRouteSettings", "{", "Domain", ":", "r", ...
// Validate will return an error if there are invalid HTTP or TCP settings for // it's given domain.
[ "Validate", "will", "return", "an", "error", "if", "there", "are", "invalid", "HTTP", "or", "TCP", "settings", "for", "it", "s", "given", "domain", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L43-L57
train
cloudfoundry/cli
actor/v2action/route.go
ValidateWithRandomPort
func (r Route) ValidateWithRandomPort(randomPort bool) error { if r.Domain.IsHTTP() && randomPort { return actionerror.InvalidHTTPRouteSettings{Domain: r.Domain.Name} } if r.Domain.IsTCP() && !r.Port.IsSet && !randomPort { return actionerror.TCPRouteOptionsNotProvidedError{} } return r.Validate() }
go
func (r Route) ValidateWithRandomPort(randomPort bool) error { if r.Domain.IsHTTP() && randomPort { return actionerror.InvalidHTTPRouteSettings{Domain: r.Domain.Name} } if r.Domain.IsTCP() && !r.Port.IsSet && !randomPort { return actionerror.TCPRouteOptionsNotProvidedError{} } return r.Validate() }
[ "func", "(", "r", "Route", ")", "ValidateWithRandomPort", "(", "randomPort", "bool", ")", "error", "{", "if", "r", ".", "Domain", ".", "IsHTTP", "(", ")", "&&", "randomPort", "{", "return", "actionerror", ".", "InvalidHTTPRouteSettings", "{", "Domain", ":", ...
// ValidateWithRandomPort will return an error if a random port is requested // for an HTTP route, or if the route is TCP, a random port wasn't requested, // and the route has no port set.
[ "ValidateWithRandomPort", "will", "return", "an", "error", "if", "a", "random", "port", "is", "requested", "for", "an", "HTTP", "route", "or", "if", "the", "route", "is", "TCP", "a", "random", "port", "wasn", "t", "requested", "and", "the", "route", "has",...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L62-L71
train
cloudfoundry/cli
actor/v2action/route.go
String
func (r Route) String() string { routeString := r.Domain.Name if r.Port.IsSet { routeString = fmt.Sprintf("%s:%d", routeString, r.Port.Value) } else if r.RandomTCPPort() { routeString = fmt.Sprintf("%s:????", routeString) } if r.Host != "" { routeString = fmt.Sprintf("%s.%s", r.Host, routeString) } if r...
go
func (r Route) String() string { routeString := r.Domain.Name if r.Port.IsSet { routeString = fmt.Sprintf("%s:%d", routeString, r.Port.Value) } else if r.RandomTCPPort() { routeString = fmt.Sprintf("%s:????", routeString) } if r.Host != "" { routeString = fmt.Sprintf("%s.%s", r.Host, routeString) } if r...
[ "func", "(", "r", "Route", ")", "String", "(", ")", "string", "{", "routeString", ":=", "r", ".", "Domain", ".", "Name", "\n\n", "if", "r", ".", "Port", ".", "IsSet", "{", "routeString", "=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "routeStrin...
// String formats the route in a human readable format.
[ "String", "formats", "the", "route", "in", "a", "human", "readable", "format", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L74-L92
train
cloudfoundry/cli
actor/v2action/route.go
GetOrphanedRoutesBySpace
func (actor Actor) GetOrphanedRoutesBySpace(spaceGUID string) ([]Route, Warnings, error) { var ( orphanedRoutes []Route allWarnings Warnings ) routes, warnings, err := actor.GetSpaceRoutes(spaceGUID) allWarnings = append(allWarnings, warnings...) if err != nil { return nil, allWarnings, err } for _, r...
go
func (actor Actor) GetOrphanedRoutesBySpace(spaceGUID string) ([]Route, Warnings, error) { var ( orphanedRoutes []Route allWarnings Warnings ) routes, warnings, err := actor.GetSpaceRoutes(spaceGUID) allWarnings = append(allWarnings, warnings...) if err != nil { return nil, allWarnings, err } for _, r...
[ "func", "(", "actor", "Actor", ")", "GetOrphanedRoutesBySpace", "(", "spaceGUID", "string", ")", "(", "[", "]", "Route", ",", "Warnings", ",", "error", ")", "{", "var", "(", "orphanedRoutes", "[", "]", "Route", "\n", "allWarnings", "Warnings", "\n", ")", ...
// GetOrphanedRoutesBySpace returns a list of orphaned routes associated with // the provided Space GUID.
[ "GetOrphanedRoutesBySpace", "returns", "a", "list", "of", "orphaned", "routes", "associated", "with", "the", "provided", "Space", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L165-L194
train
cloudfoundry/cli
actor/v2action/route.go
GetApplicationRoutes
func (actor Actor) GetApplicationRoutes(applicationGUID string) (Routes, Warnings, error) { var allWarnings Warnings ccv2Routes, warnings, err := actor.CloudControllerClient.GetApplicationRoutes(applicationGUID) allWarnings = append(allWarnings, warnings...) if err != nil { return nil, allWarnings, err } route...
go
func (actor Actor) GetApplicationRoutes(applicationGUID string) (Routes, Warnings, error) { var allWarnings Warnings ccv2Routes, warnings, err := actor.CloudControllerClient.GetApplicationRoutes(applicationGUID) allWarnings = append(allWarnings, warnings...) if err != nil { return nil, allWarnings, err } route...
[ "func", "(", "actor", "Actor", ")", "GetApplicationRoutes", "(", "applicationGUID", "string", ")", "(", "Routes", ",", "Warnings", ",", "error", ")", "{", "var", "allWarnings", "Warnings", "\n", "ccv2Routes", ",", "warnings", ",", "err", ":=", "actor", ".", ...
// GetApplicationRoutes returns a list of routes associated with the provided // Application GUID.
[ "GetApplicationRoutes", "returns", "a", "list", "of", "routes", "associated", "with", "the", "provided", "Application", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L198-L209
train
cloudfoundry/cli
actor/v2action/route.go
GetSpaceRoutes
func (actor Actor) GetSpaceRoutes(spaceGUID string) ([]Route, Warnings, error) { var allWarnings Warnings ccv2Routes, warnings, err := actor.CloudControllerClient.GetSpaceRoutes(spaceGUID) allWarnings = append(allWarnings, warnings...) if err != nil { return nil, allWarnings, err } routes, domainWarnings, err ...
go
func (actor Actor) GetSpaceRoutes(spaceGUID string) ([]Route, Warnings, error) { var allWarnings Warnings ccv2Routes, warnings, err := actor.CloudControllerClient.GetSpaceRoutes(spaceGUID) allWarnings = append(allWarnings, warnings...) if err != nil { return nil, allWarnings, err } routes, domainWarnings, err ...
[ "func", "(", "actor", "Actor", ")", "GetSpaceRoutes", "(", "spaceGUID", "string", ")", "(", "[", "]", "Route", ",", "Warnings", ",", "error", ")", "{", "var", "allWarnings", "Warnings", "\n", "ccv2Routes", ",", "warnings", ",", "err", ":=", "actor", ".",...
// GetSpaceRoutes returns a list of routes associated with the provided Space // GUID.
[ "GetSpaceRoutes", "returns", "a", "list", "of", "routes", "associated", "with", "the", "provided", "Space", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L213-L224
train
cloudfoundry/cli
actor/v2action/route.go
DeleteUnmappedRoutes
func (actor Actor) DeleteUnmappedRoutes(spaceGUID string) (Warnings, error) { warnings, err := actor.CloudControllerClient.DeleteSpaceUnmappedRoutes(spaceGUID) return Warnings(warnings), err }
go
func (actor Actor) DeleteUnmappedRoutes(spaceGUID string) (Warnings, error) { warnings, err := actor.CloudControllerClient.DeleteSpaceUnmappedRoutes(spaceGUID) return Warnings(warnings), err }
[ "func", "(", "actor", "Actor", ")", "DeleteUnmappedRoutes", "(", "spaceGUID", "string", ")", "(", "Warnings", ",", "error", ")", "{", "warnings", ",", "err", ":=", "actor", ".", "CloudControllerClient", ".", "DeleteSpaceUnmappedRoutes", "(", "spaceGUID", ")", ...
// DeleteUnmappedRoutes deletes the unmapped routes associated with the provided Space GUID.
[ "DeleteUnmappedRoutes", "deletes", "the", "unmapped", "routes", "associated", "with", "the", "provided", "Space", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L227-L230
train
cloudfoundry/cli
actor/v2action/route.go
FindRouteBoundToSpaceWithSettings
func (actor Actor) FindRouteBoundToSpaceWithSettings(route Route) (Route, Warnings, error) { existingRoute, warnings, err := actor.GetRouteByComponents(route) if routeNotFoundErr, ok := err.(actionerror.RouteNotFoundError); ok { // This check only works for API versions 2.55 or higher. It will return // false for...
go
func (actor Actor) FindRouteBoundToSpaceWithSettings(route Route) (Route, Warnings, error) { existingRoute, warnings, err := actor.GetRouteByComponents(route) if routeNotFoundErr, ok := err.(actionerror.RouteNotFoundError); ok { // This check only works for API versions 2.55 or higher. It will return // false for...
[ "func", "(", "actor", "Actor", ")", "FindRouteBoundToSpaceWithSettings", "(", "route", "Route", ")", "(", "Route", ",", "Warnings", ",", "error", ")", "{", "existingRoute", ",", "warnings", ",", "err", ":=", "actor", ".", "GetRouteByComponents", "(", "route", ...
// FindRouteBoundToSpaceWithSettings finds the route with the given host, // domain and space. If it is unable to find the route, it will check if it // exists anywhere in the system. When the route exists in another space, // RouteInDifferentSpaceError is returned. Use this when you know the space // GUID.
[ "FindRouteBoundToSpaceWithSettings", "finds", "the", "route", "with", "the", "given", "host", "domain", "and", "space", ".", "If", "it", "is", "unable", "to", "find", "the", "route", "it", "will", "check", "if", "it", "exists", "anywhere", "in", "the", "syst...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L248-L285
train
cloudfoundry/cli
actor/v2action/route.go
GetRouteByComponents
func (actor Actor) GetRouteByComponents(route Route) (Route, Warnings, error) { // TODO: validation should probably be done separately (?) if route.Domain.IsTCP() && !route.Port.IsSet { return Route{}, nil, actionerror.PortNotProvidedForQueryError{} } if route.Domain.IsShared() && route.Domain.IsHTTP() && route....
go
func (actor Actor) GetRouteByComponents(route Route) (Route, Warnings, error) { // TODO: validation should probably be done separately (?) if route.Domain.IsTCP() && !route.Port.IsSet { return Route{}, nil, actionerror.PortNotProvidedForQueryError{} } if route.Domain.IsShared() && route.Domain.IsHTTP() && route....
[ "func", "(", "actor", "Actor", ")", "GetRouteByComponents", "(", "route", "Route", ")", "(", "Route", ",", "Warnings", ",", "error", ")", "{", "// TODO: validation should probably be done separately (?)", "if", "route", ".", "Domain", ".", "IsTCP", "(", ")", "&&...
// GetRouteByComponents returns the route with the matching host, domain, path, // and port. Use this when you don't know the space GUID. // TCP routes require a port to be uniquely identified // HTTP routes using shared domains require a hostname or path to be uniquely identified
[ "GetRouteByComponents", "returns", "the", "route", "with", "the", "matching", "host", "domain", "path", "and", "port", ".", "Use", "this", "when", "you", "don", "t", "know", "the", "space", "GUID", ".", "TCP", "routes", "require", "a", "port", "to", "be", ...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/route.go#L291-L340
train
cloudfoundry/cli
actor/sharedaction/resource.go
ToV3Resource
func (r Resource) ToV3Resource() V3Resource { return V3Resource{ FilePath: r.Filename, Mode: r.Mode, Checksum: ccv3.Checksum{Value: r.SHA1}, SizeInBytes: r.Size, } }
go
func (r Resource) ToV3Resource() V3Resource { return V3Resource{ FilePath: r.Filename, Mode: r.Mode, Checksum: ccv3.Checksum{Value: r.SHA1}, SizeInBytes: r.Size, } }
[ "func", "(", "r", "Resource", ")", "ToV3Resource", "(", ")", "V3Resource", "{", "return", "V3Resource", "{", "FilePath", ":", "r", ".", "Filename", ",", "Mode", ":", "r", ".", "Mode", ",", "Checksum", ":", "ccv3", ".", "Checksum", "{", "Value", ":", ...
// ToV3Resource converts a sharedaction Resource to V3 Resource format
[ "ToV3Resource", "converts", "a", "sharedaction", "Resource", "to", "V3", "Resource", "format" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/resource.go#L49-L56
train
cloudfoundry/cli
actor/sharedaction/resource.go
ToV2Resource
func (r V3Resource) ToV2Resource() Resource { return Resource{ Filename: r.FilePath, Mode: r.Mode, SHA1: r.Checksum.Value, Size: r.SizeInBytes, } }
go
func (r V3Resource) ToV2Resource() Resource { return Resource{ Filename: r.FilePath, Mode: r.Mode, SHA1: r.Checksum.Value, Size: r.SizeInBytes, } }
[ "func", "(", "r", "V3Resource", ")", "ToV2Resource", "(", ")", "Resource", "{", "return", "Resource", "{", "Filename", ":", "r", ".", "FilePath", ",", "Mode", ":", "r", ".", "Mode", ",", "SHA1", ":", "r", ".", "Checksum", ".", "Value", ",", "Size", ...
// ToV2Resource converts a V3 Resource to V2 Resource format
[ "ToV2Resource", "converts", "a", "V3", "Resource", "to", "V2", "Resource", "format" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/resource.go#L59-L66
train
cloudfoundry/cli
actor/sharedaction/resource.go
GatherArchiveResources
func (actor Actor) GatherArchiveResources(archivePath string) ([]Resource, error) { var resources []Resource archive, err := os.Open(archivePath) if err != nil { return nil, err } defer archive.Close() reader, err := actor.newArchiveReader(archive) if err != nil { return nil, err } gitIgnore, err := act...
go
func (actor Actor) GatherArchiveResources(archivePath string) ([]Resource, error) { var resources []Resource archive, err := os.Open(archivePath) if err != nil { return nil, err } defer archive.Close() reader, err := actor.newArchiveReader(archive) if err != nil { return nil, err } gitIgnore, err := act...
[ "func", "(", "actor", "Actor", ")", "GatherArchiveResources", "(", "archivePath", "string", ")", "(", "[", "]", "Resource", ",", "error", ")", "{", "var", "resources", "[", "]", "Resource", "\n\n", "archive", ",", "err", ":=", "os", ".", "Open", "(", "...
// GatherArchiveResources returns a list of resources for an archive.
[ "GatherArchiveResources", "returns", "a", "list", "of", "resources", "for", "an", "archive", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/resource.go#L69-L128
train
cloudfoundry/cli
actor/sharedaction/resource.go
GatherDirectoryResources
func (actor Actor) GatherDirectoryResources(sourceDir string) ([]Resource, error) { var ( resources []Resource gitIgnore *ignore.GitIgnore ) gitIgnore, err := actor.generateDirectoryCFIgnoreMatcher(sourceDir) if err != nil { log.Errorln("reading .cfignore file:", err) return nil, err } evalDir, err := f...
go
func (actor Actor) GatherDirectoryResources(sourceDir string) ([]Resource, error) { var ( resources []Resource gitIgnore *ignore.GitIgnore ) gitIgnore, err := actor.generateDirectoryCFIgnoreMatcher(sourceDir) if err != nil { log.Errorln("reading .cfignore file:", err) return nil, err } evalDir, err := f...
[ "func", "(", "actor", "Actor", ")", "GatherDirectoryResources", "(", "sourceDir", "string", ")", "(", "[", "]", "Resource", ",", "error", ")", "{", "var", "(", "resources", "[", "]", "Resource", "\n", "gitIgnore", "*", "ignore", ".", "GitIgnore", "\n", "...
// GatherDirectoryResources returns a list of resources for a directory.
[ "GatherDirectoryResources", "returns", "a", "list", "of", "resources", "for", "a", "directory", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/resource.go#L131-L210
train
cloudfoundry/cli
api/cloudcontroller/ccv2/application.go
MarshalJSON
func (application Application) MarshalJSON() ([]byte, error) { ccApp := struct { Buildpack *string `json:"buildpack,omitempty"` Command *string `json:"command,omitempty"` DiskQuota *uint64 ...
go
func (application Application) MarshalJSON() ([]byte, error) { ccApp := struct { Buildpack *string `json:"buildpack,omitempty"` Command *string `json:"command,omitempty"` DiskQuota *uint64 ...
[ "func", "(", "application", "Application", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "ccApp", ":=", "struct", "{", "Buildpack", "*", "string", "`json:\"buildpack,omitempty\"`", "\n", "Command", "*", "string", "`json:\"command...
// MarshalJSON converts an application into a Cloud Controller Application.
[ "MarshalJSON", "converts", "an", "application", "into", "a", "Cloud", "Controller", "Application", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/application.go#L89-L149
train
cloudfoundry/cli
api/cloudcontroller/ccv2/application.go
CreateApplication
func (client *Client) CreateApplication(app Application) (Application, Warnings, error) { body, err := json.Marshal(app) if err != nil { return Application{}, nil, err } request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostAppRequest, Body: bytes.NewReader(body), }) if err...
go
func (client *Client) CreateApplication(app Application) (Application, Warnings, error) { body, err := json.Marshal(app) if err != nil { return Application{}, nil, err } request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostAppRequest, Body: bytes.NewReader(body), }) if err...
[ "func", "(", "client", "*", "Client", ")", "CreateApplication", "(", "app", "Application", ")", "(", "Application", ",", "Warnings", ",", "error", ")", "{", "body", ",", "err", ":=", "json", ".", "Marshal", "(", "app", ")", "\n", "if", "err", "!=", "...
// CreateApplication creates a cloud controller application in with the given // settings. SpaceGUID and Name are the only required fields.
[ "CreateApplication", "creates", "a", "cloud", "controller", "application", "in", "with", "the", "given", "settings", ".", "SpaceGUID", "and", "Name", "are", "the", "only", "required", "fields", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/application.go#L227-L248
train
cloudfoundry/cli
api/cloudcontroller/ccv2/application.go
GetApplication
func (client *Client) GetApplication(guid string) (Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetAppRequest, URIParams: Params{"app_guid": guid}, }) if err != nil { return Application{}, nil, err } var app Application response := cloudcontr...
go
func (client *Client) GetApplication(guid string) (Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetAppRequest, URIParams: Params{"app_guid": guid}, }) if err != nil { return Application{}, nil, err } var app Application response := cloudcontr...
[ "func", "(", "client", "*", "Client", ")", "GetApplication", "(", "guid", "string", ")", "(", "Application", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", "...
// GetApplication returns back an Application.
[ "GetApplication", "returns", "back", "an", "Application", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/application.go#L251-L267
train
cloudfoundry/cli
api/cloudcontroller/ccv2/application.go
GetRouteApplications
func (client *Client) GetRouteApplications(routeGUID string, filters ...Filter) ([]Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetRouteAppsRequest, URIParams: map[string]string{"route_guid": routeGUID}, Query: ConvertFilterParameters(filters...
go
func (client *Client) GetRouteApplications(routeGUID string, filters ...Filter) ([]Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetRouteAppsRequest, URIParams: map[string]string{"route_guid": routeGUID}, Query: ConvertFilterParameters(filters...
[ "func", "(", "client", "*", "Client", ")", "GetRouteApplications", "(", "routeGUID", "string", ",", "filters", "...", "Filter", ")", "(", "[", "]", "Application", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHT...
// GetRouteApplications returns a list of Applications based off a route // GUID and the provided filters.
[ "GetRouteApplications", "returns", "a", "list", "of", "Applications", "based", "off", "a", "route", "GUID", "and", "the", "provided", "filters", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/application.go#L298-L322
train
cloudfoundry/cli
api/cloudcontroller/ccv2/application.go
RestageApplication
func (client *Client) RestageApplication(app Application) (Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostAppRestageRequest, URIParams: Params{"app_guid": app.GUID}, }) if err != nil { return Application{}, nil, err } var restagedApp Applica...
go
func (client *Client) RestageApplication(app Application) (Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostAppRestageRequest, URIParams: Params{"app_guid": app.GUID}, }) if err != nil { return Application{}, nil, err } var restagedApp Applica...
[ "func", "(", "client", "*", "Client", ")", "RestageApplication", "(", "app", "Application", ")", "(", "Application", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestNa...
// RestageApplication restages the application with the given GUID.
[ "RestageApplication", "restages", "the", "application", "with", "the", "given", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/application.go#L325-L341
train
cloudfoundry/cli
actor/pushaction/application.go
CalculatedBuildpacks
func (app Application) CalculatedBuildpacks() []string { buildpack := app.CalculatedBuildpack() switch { case app.Buildpacks != nil: return app.Buildpacks case len(buildpack) > 0: return []string{buildpack} default: return nil } }
go
func (app Application) CalculatedBuildpacks() []string { buildpack := app.CalculatedBuildpack() switch { case app.Buildpacks != nil: return app.Buildpacks case len(buildpack) > 0: return []string{buildpack} default: return nil } }
[ "func", "(", "app", "Application", ")", "CalculatedBuildpacks", "(", ")", "[", "]", "string", "{", "buildpack", ":=", "app", ".", "CalculatedBuildpack", "(", ")", "\n", "switch", "{", "case", "app", ".", "Buildpacks", "!=", "nil", ":", "return", "app", "...
// CalculatedBuildpacks will return back the buildpacks for the application.
[ "CalculatedBuildpacks", "will", "return", "back", "the", "buildpacks", "for", "the", "application", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pushaction/application.go#L22-L32
train
cloudfoundry/cli
actor/pushaction/application.go
ignoreSameStackGUID
func (actor Actor) ignoreSameStackGUID(config ApplicationConfig, v2App v2action.Application) v2action.Application { if config.CurrentApplication.StackGUID == config.DesiredApplication.StackGUID { v2App.StackGUID = "" } return v2App }
go
func (actor Actor) ignoreSameStackGUID(config ApplicationConfig, v2App v2action.Application) v2action.Application { if config.CurrentApplication.StackGUID == config.DesiredApplication.StackGUID { v2App.StackGUID = "" } return v2App }
[ "func", "(", "actor", "Actor", ")", "ignoreSameStackGUID", "(", "config", "ApplicationConfig", ",", "v2App", "v2action", ".", "Application", ")", "v2action", ".", "Application", "{", "if", "config", ".", "CurrentApplication", ".", "StackGUID", "==", "config", "....
// Apps updates with both docker image and stack guids fail. So do not send // StackGUID unless it is necessary.
[ "Apps", "updates", "with", "both", "docker", "image", "and", "stack", "guids", "fail", ".", "So", "do", "not", "send", "StackGUID", "unless", "it", "is", "necessary", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pushaction/application.go#L155-L161
train
cloudfoundry/cli
api/plugin/client.go
NewClient
func NewClient(config Config) *Client { userAgent := fmt.Sprintf("%s/%s (%s; %s %s)", config.AppName, config.AppVersion, runtime.Version(), runtime.GOARCH, runtime.GOOS, ) client := Client{ userAgent: userAgent, connection: NewConnection(config.SkipSSLValidation, config.DialTimeout), } return &clie...
go
func NewClient(config Config) *Client { userAgent := fmt.Sprintf("%s/%s (%s; %s %s)", config.AppName, config.AppVersion, runtime.Version(), runtime.GOARCH, runtime.GOOS, ) client := Client{ userAgent: userAgent, connection: NewConnection(config.SkipSSLValidation, config.DialTimeout), } return &clie...
[ "func", "NewClient", "(", "config", "Config", ")", "*", "Client", "{", "userAgent", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "config", ".", "AppName", ",", "config", ".", "AppVersion", ",", "runtime", ".", "Version", "(", ")", ",", "runtime",...
// NewClient returns a new plugin Client.
[ "NewClient", "returns", "a", "new", "plugin", "Client", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/plugin/client.go#L39-L53
train
cloudfoundry/cli
actor/v7pushaction/update_application_settings.go
UpdateApplicationSettings
func (actor Actor) UpdateApplicationSettings(pushPlans []PushPlan) ([]PushPlan, Warnings, error) { appNames := actor.getAppNames(pushPlans) applications, getWarnings, err := actor.V7Actor.GetApplicationsByNamesAndSpace(appNames, pushPlans[0].SpaceGUID) warnings := Warnings(getWarnings) if err != nil { log.Errorln...
go
func (actor Actor) UpdateApplicationSettings(pushPlans []PushPlan) ([]PushPlan, Warnings, error) { appNames := actor.getAppNames(pushPlans) applications, getWarnings, err := actor.V7Actor.GetApplicationsByNamesAndSpace(appNames, pushPlans[0].SpaceGUID) warnings := Warnings(getWarnings) if err != nil { log.Errorln...
[ "func", "(", "actor", "Actor", ")", "UpdateApplicationSettings", "(", "pushPlans", "[", "]", "PushPlan", ")", "(", "[", "]", "PushPlan", ",", "Warnings", ",", "error", ")", "{", "appNames", ":=", "actor", ".", "getAppNames", "(", "pushPlans", ")", "\n", ...
// UpdateApplicationSettings syncs the Application state and GUID with the API.
[ "UpdateApplicationSettings", "syncs", "the", "Application", "state", "and", "GUID", "with", "the", "API", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7pushaction/update_application_settings.go#L10-L31
train
cloudfoundry/cli
cf/api/logs/noaa_message_queue.go
Less
func (pq *NoaaMessageQueue) Less(i, j int) bool { return *pq.messages[i].Timestamp < *pq.messages[j].Timestamp }
go
func (pq *NoaaMessageQueue) Less(i, j int) bool { return *pq.messages[i].Timestamp < *pq.messages[j].Timestamp }
[ "func", "(", "pq", "*", "NoaaMessageQueue", ")", "Less", "(", "i", ",", "j", "int", ")", "bool", "{", "return", "*", "pq", ".", "messages", "[", "i", "]", ".", "Timestamp", "<", "*", "pq", ".", "messages", "[", "j", "]", ".", "Timestamp", "\n", ...
// implement sort interface so we can sort messages as we receive them in PushMessage
[ "implement", "sort", "interface", "so", "we", "can", "sort", "messages", "as", "we", "receive", "them", "in", "PushMessage" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/api/logs/noaa_message_queue.go#L27-L29
train
cloudfoundry/cli
actor/v7pushaction/create_push_plans.go
CreatePushPlans
func (actor Actor) CreatePushPlans(appNameArg string, spaceGUID string, orgGUID string, parser ManifestParser, overrides FlagOverrides) ([]PushPlan, error) { var pushPlans []PushPlan eligibleApps, err := actor.getEligibleApplications(parser, appNameArg) if err != nil { return nil, err } for _, manifestApplicat...
go
func (actor Actor) CreatePushPlans(appNameArg string, spaceGUID string, orgGUID string, parser ManifestParser, overrides FlagOverrides) ([]PushPlan, error) { var pushPlans []PushPlan eligibleApps, err := actor.getEligibleApplications(parser, appNameArg) if err != nil { return nil, err } for _, manifestApplicat...
[ "func", "(", "actor", "Actor", ")", "CreatePushPlans", "(", "appNameArg", "string", ",", "spaceGUID", "string", ",", "orgGUID", "string", ",", "parser", "ManifestParser", ",", "overrides", "FlagOverrides", ")", "(", "[", "]", "PushPlan", ",", "error", ")", "...
// CreatePushPlans returns a set of PushPlan objects based off the inputs // provided. It's assumed that all flag and argument and manifest combinations // have been validated prior to calling this function.
[ "CreatePushPlans", "returns", "a", "set", "of", "PushPlan", "objects", "based", "off", "the", "inputs", "provided", ".", "It", "s", "assumed", "that", "all", "flag", "and", "argument", "and", "manifest", "combinations", "have", "been", "validated", "prior", "t...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7pushaction/create_push_plans.go#L10-L37
train
cloudfoundry/cli
api/cloudcontroller/ccv3/buildpack.go
DeleteBuildpack
func (client Client) DeleteBuildpack(buildpackGUID string) (JobURL, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteBuildpackRequest, URIParams: map[string]string{ "buildpack_guid": buildpackGUID, }, }) if err != nil { return "", nil, err } response ...
go
func (client Client) DeleteBuildpack(buildpackGUID string) (JobURL, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteBuildpackRequest, URIParams: map[string]string{ "buildpack_guid": buildpackGUID, }, }) if err != nil { return "", nil, err } response ...
[ "func", "(", "client", "Client", ")", "DeleteBuildpack", "(", "buildpackGUID", "string", ")", "(", "JobURL", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ":"...
// DeleteBuildpack deletes the buildpack with the provided guid.
[ "DeleteBuildpack", "deletes", "the", "buildpack", "with", "the", "provided", "guid", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/buildpack.go#L122-L137
train
cloudfoundry/cli
actor/v7pushaction/resource_match.go
MatchResources
func (actor Actor) MatchResources(resources []sharedaction.V3Resource) ([]sharedaction.V3Resource, []sharedaction.V3Resource, Warnings, error) { matches, warnings, err := actor.V7Actor.ResourceMatch(resources) mapChecksumToResource := map[string]sharedaction.V3Resource{} for _, resource := range matches { mapChec...
go
func (actor Actor) MatchResources(resources []sharedaction.V3Resource) ([]sharedaction.V3Resource, []sharedaction.V3Resource, Warnings, error) { matches, warnings, err := actor.V7Actor.ResourceMatch(resources) mapChecksumToResource := map[string]sharedaction.V3Resource{} for _, resource := range matches { mapChec...
[ "func", "(", "actor", "Actor", ")", "MatchResources", "(", "resources", "[", "]", "sharedaction", ".", "V3Resource", ")", "(", "[", "]", "sharedaction", ".", "V3Resource", ",", "[", "]", "sharedaction", ".", "V3Resource", ",", "Warnings", ",", "error", ")"...
// MatchResources returns back a list of matched and unmatched resources for the provided resources.
[ "MatchResources", "returns", "back", "a", "list", "of", "matched", "and", "unmatched", "resources", "for", "the", "provided", "resources", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7pushaction/resource_match.go#L6-L22
train
cloudfoundry/cli
api/cloudcontroller/ccv2/user.go
UnmarshalJSON
func (user *User) UnmarshalJSON(data []byte) error { var ccUser struct { Metadata internal.Metadata `json:"metadata"` } err := cloudcontroller.DecodeJSON(data, &ccUser) if err != nil { return err } user.GUID = ccUser.Metadata.GUID return nil }
go
func (user *User) UnmarshalJSON(data []byte) error { var ccUser struct { Metadata internal.Metadata `json:"metadata"` } err := cloudcontroller.DecodeJSON(data, &ccUser) if err != nil { return err } user.GUID = ccUser.Metadata.GUID return nil }
[ "func", "(", "user", "*", "User", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "ccUser", "struct", "{", "Metadata", "internal", ".", "Metadata", "`json:\"metadata\"`", "\n", "}", "\n", "err", ":=", "cloudcontroller", ".", ...
// UnmarshalJSON helps unmarshal a Cloud Controller User response.
[ "UnmarshalJSON", "helps", "unmarshal", "a", "Cloud", "Controller", "User", "response", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/user.go#L18-L29
train
cloudfoundry/cli
api/cloudcontroller/ccv2/user.go
CreateUser
func (client *Client) CreateUser(uaaUserID string) (User, Warnings, error) { type userRequestBody struct { GUID string `json:"guid"` } bodyBytes, err := json.Marshal(userRequestBody{ GUID: uaaUserID, }) if err != nil { return User{}, nil, err } request, err := client.newHTTPRequest(requestOptions{ Requ...
go
func (client *Client) CreateUser(uaaUserID string) (User, Warnings, error) { type userRequestBody struct { GUID string `json:"guid"` } bodyBytes, err := json.Marshal(userRequestBody{ GUID: uaaUserID, }) if err != nil { return User{}, nil, err } request, err := client.newHTTPRequest(requestOptions{ Requ...
[ "func", "(", "client", "*", "Client", ")", "CreateUser", "(", "uaaUserID", "string", ")", "(", "User", ",", "Warnings", ",", "error", ")", "{", "type", "userRequestBody", "struct", "{", "GUID", "string", "`json:\"guid\"`", "\n", "}", "\n\n", "bodyBytes", "...
// CreateUser creates a new Cloud Controller User from the provided UAA user // ID.
[ "CreateUser", "creates", "a", "new", "Cloud", "Controller", "User", "from", "the", "provided", "UAA", "user", "ID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/user.go#L33-L64
train
cloudfoundry/cli
api/router/client.go
NewClient
func NewClient(config Config) *Client { userAgent := fmt.Sprintf("%s/%s (%s; %s %s)", config.AppName, config.AppVersion, runtime.Version(), runtime.GOARCH, runtime.GOOS, ) client := Client{ userAgent: userAgent, router: rata.NewRequestGenerator(config.RoutingEndpoint, internal.APIRoutes), conne...
go
func NewClient(config Config) *Client { userAgent := fmt.Sprintf("%s/%s (%s; %s %s)", config.AppName, config.AppVersion, runtime.Version(), runtime.GOARCH, runtime.GOOS, ) client := Client{ userAgent: userAgent, router: rata.NewRequestGenerator(config.RoutingEndpoint, internal.APIRoutes), conne...
[ "func", "NewClient", "(", "config", "Config", ")", "*", "Client", "{", "userAgent", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "config", ".", "AppName", ",", "config", ".", "AppVersion", ",", "runtime", ".", "Version", "(", ")", ",", "runtime",...
// NewClient returns a new Router Client.
[ "NewClient", "returns", "a", "new", "Router", "Client", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/router/client.go#L42-L62
train
cloudfoundry/cli
api/cloudcontroller/ccv2/service_instance_shared_from.go
GetServiceInstanceSharedFrom
func (client *Client) GetServiceInstanceSharedFrom(serviceInstanceGUID string) (ServiceInstanceSharedFrom, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceInstanceSharedFromRequest, URIParams: Params{"service_instance_guid": serviceInstanceGUID}, }) if e...
go
func (client *Client) GetServiceInstanceSharedFrom(serviceInstanceGUID string) (ServiceInstanceSharedFrom, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceInstanceSharedFromRequest, URIParams: Params{"service_instance_guid": serviceInstanceGUID}, }) if e...
[ "func", "(", "client", "*", "Client", ")", "GetServiceInstanceSharedFrom", "(", "serviceInstanceGUID", "string", ")", "(", "ServiceInstanceSharedFrom", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "r...
// GetServiceInstanceSharedFrom returns back a ServiceInstanceSharedFrom // object.
[ "GetServiceInstanceSharedFrom", "returns", "back", "a", "ServiceInstanceSharedFrom", "object", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance_shared_from.go#L26-L42
train
cloudfoundry/cli
api/cloudcontroller/ccv3/feature_flag.go
GetFeatureFlags
func (client *Client) GetFeatureFlags() ([]FeatureFlag, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetFeatureFlagsRequest, }) if err != nil { return nil, nil, err } var fullFeatureFlagList []FeatureFlag warnings, err := client.paginate(request, FeatureFlag...
go
func (client *Client) GetFeatureFlags() ([]FeatureFlag, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetFeatureFlagsRequest, }) if err != nil { return nil, nil, err } var fullFeatureFlagList []FeatureFlag warnings, err := client.paginate(request, FeatureFlag...
[ "func", "(", "client", "*", "Client", ")", "GetFeatureFlags", "(", ")", "(", "[", "]", "FeatureFlag", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ":", "...
// GetFeatureFlags lists feature flags.
[ "GetFeatureFlags", "lists", "feature", "flags", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/feature_flag.go#L51-L75
train
cloudfoundry/cli
command/v7/ssh_command.go
EvaluateTTYOption
func (cmd SSHCommand) EvaluateTTYOption() (sharedaction.TTYOption, error) { var count int option := sharedaction.RequestTTYAuto if cmd.DisablePseudoTTY { option = sharedaction.RequestTTYNo count++ } if cmd.ForcePseudoTTY { option = sharedaction.RequestTTYForce count++ } if cmd.RequestPseudoTTY { optio...
go
func (cmd SSHCommand) EvaluateTTYOption() (sharedaction.TTYOption, error) { var count int option := sharedaction.RequestTTYAuto if cmd.DisablePseudoTTY { option = sharedaction.RequestTTYNo count++ } if cmd.ForcePseudoTTY { option = sharedaction.RequestTTYForce count++ } if cmd.RequestPseudoTTY { optio...
[ "func", "(", "cmd", "SSHCommand", ")", "EvaluateTTYOption", "(", ")", "(", "sharedaction", ".", "TTYOption", ",", "error", ")", "{", "var", "count", "int", "\n\n", "option", ":=", "sharedaction", ".", "RequestTTYAuto", "\n", "if", "cmd", ".", "DisablePseudoT...
// EvaluateTTYOption determines which TTY options are mutually exclusive and // returns an error accordingly.
[ "EvaluateTTYOption", "determines", "which", "TTY", "options", "are", "mutually", "exclusive", "and", "returns", "an", "error", "accordingly", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v7/ssh_command.go#L118-L142
train
cloudfoundry/cli
actor/v2action/space_quota.go
GetSpaceQuotaByName
func (actor Actor) GetSpaceQuotaByName(quotaName, orgGUID string) (SpaceQuota, Warnings, error) { quotas, warnings, err := actor.CloudControllerClient.GetSpaceQuotas(orgGUID) if err != nil { return SpaceQuota{}, Warnings(warnings), err } for _, quota := range quotas { if quota.Name == quotaName { return Sp...
go
func (actor Actor) GetSpaceQuotaByName(quotaName, orgGUID string) (SpaceQuota, Warnings, error) { quotas, warnings, err := actor.CloudControllerClient.GetSpaceQuotas(orgGUID) if err != nil { return SpaceQuota{}, Warnings(warnings), err } for _, quota := range quotas { if quota.Name == quotaName { return Sp...
[ "func", "(", "actor", "Actor", ")", "GetSpaceQuotaByName", "(", "quotaName", ",", "orgGUID", "string", ")", "(", "SpaceQuota", ",", "Warnings", ",", "error", ")", "{", "quotas", ",", "warnings", ",", "err", ":=", "actor", ".", "CloudControllerClient", ".", ...
// GetSpaceQuotaByName finds the quota by name and returns an error if not found
[ "GetSpaceQuotaByName", "finds", "the", "quota", "by", "name", "and", "returns", "an", "error", "if", "not", "found" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space_quota.go#L22-L36
train
cloudfoundry/cli
actor/v2action/space_quota.go
SetSpaceQuota
func (actor Actor) SetSpaceQuota(spaceGUID, quotaGUID string) (Warnings, error) { warnings, err := actor.CloudControllerClient.SetSpaceQuota(spaceGUID, quotaGUID) return Warnings(warnings), err }
go
func (actor Actor) SetSpaceQuota(spaceGUID, quotaGUID string) (Warnings, error) { warnings, err := actor.CloudControllerClient.SetSpaceQuota(spaceGUID, quotaGUID) return Warnings(warnings), err }
[ "func", "(", "actor", "Actor", ")", "SetSpaceQuota", "(", "spaceGUID", ",", "quotaGUID", "string", ")", "(", "Warnings", ",", "error", ")", "{", "warnings", ",", "err", ":=", "actor", ".", "CloudControllerClient", ".", "SetSpaceQuota", "(", "spaceGUID", ",",...
// SetSpaceQuota sets the space quota for the corresponding space
[ "SetSpaceQuota", "sets", "the", "space", "quota", "for", "the", "corresponding", "space" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space_quota.go#L39-L42
train
cloudfoundry/cli
actor/v2action/domain.go
GetDomain
func (actor Actor) GetDomain(domainGUID string) (Domain, Warnings, error) { var allWarnings Warnings domain, warnings, err := actor.GetSharedDomain(domainGUID) allWarnings = append(allWarnings, warnings...) switch err.(type) { case nil: return domain, allWarnings, nil case actionerror.DomainNotFoundError: def...
go
func (actor Actor) GetDomain(domainGUID string) (Domain, Warnings, error) { var allWarnings Warnings domain, warnings, err := actor.GetSharedDomain(domainGUID) allWarnings = append(allWarnings, warnings...) switch err.(type) { case nil: return domain, allWarnings, nil case actionerror.DomainNotFoundError: def...
[ "func", "(", "actor", "Actor", ")", "GetDomain", "(", "domainGUID", "string", ")", "(", "Domain", ",", "Warnings", ",", "error", ")", "{", "var", "allWarnings", "Warnings", "\n\n", "domain", ",", "warnings", ",", "err", ":=", "actor", ".", "GetSharedDomain...
// GetDomain returns the shared or private domain associated with the provided // Domain GUID.
[ "GetDomain", "returns", "the", "shared", "or", "private", "domain", "associated", "with", "the", "provided", "Domain", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/domain.go#L45-L66
train
cloudfoundry/cli
actor/v2action/domain.go
GetDomainsByNameAndOrganization
func (actor Actor) GetDomainsByNameAndOrganization(domainNames []string, orgGUID string) ([]Domain, Warnings, error) { if len(domainNames) == 0 { return nil, nil, nil } var domains []Domain var allWarnings Warnings // TODO: If the following causes URI length problems, break domainNames into // batched (based ...
go
func (actor Actor) GetDomainsByNameAndOrganization(domainNames []string, orgGUID string) ([]Domain, Warnings, error) { if len(domainNames) == 0 { return nil, nil, nil } var domains []Domain var allWarnings Warnings // TODO: If the following causes URI length problems, break domainNames into // batched (based ...
[ "func", "(", "actor", "Actor", ")", "GetDomainsByNameAndOrganization", "(", "domainNames", "[", "]", "string", ",", "orgGUID", "string", ")", "(", "[", "]", "Domain", ",", "Warnings", ",", "error", ")", "{", "if", "len", "(", "domainNames", ")", "==", "0...
// GetDomainsByNameAndOrganization returns back a list of domains given a list // of domains names and the organization GUID. If no domains are given, than this // command will not lookup any domains.
[ "GetDomainsByNameAndOrganization", "returns", "back", "a", "list", "of", "domains", "given", "a", "list", "of", "domains", "names", "and", "the", "organization", "GUID", ".", "If", "no", "domains", "are", "given", "than", "this", "command", "will", "not", "loo...
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/domain.go#L71-L115
train
cloudfoundry/cli
actor/v2action/domain.go
GetSharedDomain
func (actor Actor) GetSharedDomain(domainGUID string) (Domain, Warnings, error) { if domain, found := actor.loadDomain(domainGUID); found { log.WithFields(log.Fields{ "domain": domain.Name, "GUID": domain.GUID, }).Debug("using domain from cache") return domain, nil, nil } domain, warnings, err := acto...
go
func (actor Actor) GetSharedDomain(domainGUID string) (Domain, Warnings, error) { if domain, found := actor.loadDomain(domainGUID); found { log.WithFields(log.Fields{ "domain": domain.Name, "GUID": domain.GUID, }).Debug("using domain from cache") return domain, nil, nil } domain, warnings, err := acto...
[ "func", "(", "actor", "Actor", ")", "GetSharedDomain", "(", "domainGUID", "string", ")", "(", "Domain", ",", "Warnings", ",", "error", ")", "{", "if", "domain", ",", "found", ":=", "actor", ".", "loadDomain", "(", "domainGUID", ")", ";", "found", "{", ...
// GetSharedDomain returns the shared domain associated with the provided // Domain GUID.
[ "GetSharedDomain", "returns", "the", "shared", "domain", "associated", "with", "the", "provided", "Domain", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/domain.go#L146-L162
train
cloudfoundry/cli
actor/v2action/domain.go
GetOrganizationDomains
func (actor Actor) GetOrganizationDomains(orgGUID string) ([]Domain, Warnings, error) { var ( allWarnings Warnings allDomains []Domain ) domains, warnings, err := actor.CloudControllerClient.GetSharedDomains() allWarnings = append(allWarnings, warnings...) if err != nil { return []Domain{}, allWarnings, e...
go
func (actor Actor) GetOrganizationDomains(orgGUID string) ([]Domain, Warnings, error) { var ( allWarnings Warnings allDomains []Domain ) domains, warnings, err := actor.CloudControllerClient.GetSharedDomains() allWarnings = append(allWarnings, warnings...) if err != nil { return []Domain{}, allWarnings, e...
[ "func", "(", "actor", "Actor", ")", "GetOrganizationDomains", "(", "orgGUID", "string", ")", "(", "[", "]", "Domain", ",", "Warnings", ",", "error", ")", "{", "var", "(", "allWarnings", "Warnings", "\n", "allDomains", "[", "]", "Domain", "\n", ")", "\n\n...
// GetOrganizationDomains returns the shared and private domains associated // with an organization.
[ "GetOrganizationDomains", "returns", "the", "shared", "and", "private", "domains", "associated", "with", "an", "organization", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/domain.go#L186-L213
train
cloudfoundry/cli
actor/v7action/process_instance.go
StartTime
func (instance *ProcessInstance) StartTime() time.Time { return time.Now().Add(-instance.Uptime) }
go
func (instance *ProcessInstance) StartTime() time.Time { return time.Now().Add(-instance.Uptime) }
[ "func", "(", "instance", "*", "ProcessInstance", ")", "StartTime", "(", ")", "time", ".", "Time", "{", "return", "time", ".", "Now", "(", ")", ".", "Add", "(", "-", "instance", ".", "Uptime", ")", "\n", "}" ]
// StartTime returns the time that the instance started.
[ "StartTime", "returns", "the", "time", "that", "the", "instance", "started", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/process_instance.go#L21-L23
train
cloudfoundry/cli
command/plugin/shared/new_client.go
NewClient
func NewClient(config command.Config, ui command.UI, skipSSLValidation bool) *plugin.Client { verbose, location := config.Verbose() pluginClient := plugin.NewClient(plugin.Config{ AppName: config.BinaryName(), AppVersion: config.BinaryVersion(), DialTimeout: config.DialTimeout(), Skip...
go
func NewClient(config command.Config, ui command.UI, skipSSLValidation bool) *plugin.Client { verbose, location := config.Verbose() pluginClient := plugin.NewClient(plugin.Config{ AppName: config.BinaryName(), AppVersion: config.BinaryVersion(), DialTimeout: config.DialTimeout(), Skip...
[ "func", "NewClient", "(", "config", "command", ".", "Config", ",", "ui", "command", ".", "UI", ",", "skipSSLValidation", "bool", ")", "*", "plugin", ".", "Client", "{", "verbose", ",", "location", ":=", "config", ".", "Verbose", "(", ")", "\n\n", "plugin...
// NewClient creates a new V2 Cloud Controller client and UAA client using the // passed in config.
[ "NewClient", "creates", "a", "new", "V2", "Cloud", "Controller", "client", "and", "UAA", "client", "using", "the", "passed", "in", "config", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/plugin/shared/new_client.go#L11-L32
train
cloudfoundry/cli
api/uaa/resources.go
SetupResources
func (client *Client) SetupResources(bootstrapURL string) error { request, err := client.newRequest(requestOptions{ Method: http.MethodGet, URL: fmt.Sprintf("%s/login", bootstrapURL), }) if err != nil { return err } info := NewInfo(bootstrapURL) response := Response{ Result: &info, } err = client....
go
func (client *Client) SetupResources(bootstrapURL string) error { request, err := client.newRequest(requestOptions{ Method: http.MethodGet, URL: fmt.Sprintf("%s/login", bootstrapURL), }) if err != nil { return err } info := NewInfo(bootstrapURL) response := Response{ Result: &info, } err = client....
[ "func", "(", "client", "*", "Client", ")", "SetupResources", "(", "bootstrapURL", "string", ")", "error", "{", "request", ",", "err", ":=", "client", ".", "newRequest", "(", "requestOptions", "{", "Method", ":", "http", ".", "MethodGet", ",", "URL", ":", ...
// SetupResources configures the client to use the specified settings and diescopers the UAA and Authentication resources
[ "SetupResources", "configures", "the", "client", "to", "use", "the", "specified", "settings", "and", "diescopers", "the", "UAA", "and", "Authentication", "resources" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/resources.go#L11-L42
train
cloudfoundry/cli
actor/sharedaction/help.go
CommandInfoByName
func (Actor) CommandInfoByName(commandList interface{}, commandName string) (CommandInfo, error) { field, found := reflect.TypeOf(commandList).FieldByNameFunc( func(fieldName string) bool { field, _ := reflect.TypeOf(commandList).FieldByName(fieldName) return field.Tag.Get("command") == commandName || field.Ta...
go
func (Actor) CommandInfoByName(commandList interface{}, commandName string) (CommandInfo, error) { field, found := reflect.TypeOf(commandList).FieldByNameFunc( func(fieldName string) bool { field, _ := reflect.TypeOf(commandList).FieldByName(fieldName) return field.Tag.Get("command") == commandName || field.Ta...
[ "func", "(", "Actor", ")", "CommandInfoByName", "(", "commandList", "interface", "{", "}", ",", "commandName", "string", ")", "(", "CommandInfo", ",", "error", ")", "{", "field", ",", "found", ":=", "reflect", ".", "TypeOf", "(", "commandList", ")", ".", ...
// CommandInfoByName returns the help information for a particular commandName in // the commandList.
[ "CommandInfoByName", "returns", "the", "help", "information", "for", "a", "particular", "commandName", "in", "the", "commandList", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/help.go#L60-L120
train
cloudfoundry/cli
actor/sharedaction/help.go
CommandInfos
func (Actor) CommandInfos(commandList interface{}) map[string]CommandInfo { handler := reflect.TypeOf(commandList) infos := make(map[string]CommandInfo, handler.NumField()) for i := 0; i < handler.NumField(); i++ { fieldTag := handler.Field(i).Tag commandName := fieldTag.Get("command") infos[commandName] = Co...
go
func (Actor) CommandInfos(commandList interface{}) map[string]CommandInfo { handler := reflect.TypeOf(commandList) infos := make(map[string]CommandInfo, handler.NumField()) for i := 0; i < handler.NumField(); i++ { fieldTag := handler.Field(i).Tag commandName := fieldTag.Get("command") infos[commandName] = Co...
[ "func", "(", "Actor", ")", "CommandInfos", "(", "commandList", "interface", "{", "}", ")", "map", "[", "string", "]", "CommandInfo", "{", "handler", ":=", "reflect", ".", "TypeOf", "(", "commandList", ")", "\n\n", "infos", ":=", "make", "(", "map", "[", ...
// CommandInfos returns a slice of CommandInfo that only fills in // the Name and Description for all the commands in commandList
[ "CommandInfos", "returns", "a", "slice", "of", "CommandInfo", "that", "only", "fills", "in", "the", "Name", "and", "Description", "for", "all", "the", "commands", "in", "commandList" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/help.go#L124-L139
train
cloudfoundry/cli
api/cloudcontroller/ccv3/resource.go
UnmarshalJSON
func (r *Resource) UnmarshalJSON(data []byte) error { var ccResource struct { FilePath string `json:"path,omitempty"` Mode string `json:"mode,omitempty"` Checksum Checksum `json:"checksum"` SizeInBytes int64 `json:"size_in_bytes"` } err := cloudcontroller.DecodeJSON(data, &ccResource) i...
go
func (r *Resource) UnmarshalJSON(data []byte) error { var ccResource struct { FilePath string `json:"path,omitempty"` Mode string `json:"mode,omitempty"` Checksum Checksum `json:"checksum"` SizeInBytes int64 `json:"size_in_bytes"` } err := cloudcontroller.DecodeJSON(data, &ccResource) i...
[ "func", "(", "r", "*", "Resource", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "ccResource", "struct", "{", "FilePath", "string", "`json:\"path,omitempty\"`", "\n", "Mode", "string", "`json:\"mode,omitempty\"`", "\n", "Checksum...
// UnmarshalJSON helps unmarshal a Cloud Controller Resource response.
[ "UnmarshalJSON", "helps", "unmarshal", "a", "Cloud", "Controller", "Resource", "response", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/resource.go#L58-L81
train
cloudfoundry/cli
api/cloudcontroller/ccv3/job_url.go
DeleteApplication
func (client *Client) DeleteApplication(appGUID string) (JobURL, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteApplicationRequest, URIParams: internal.Params{"app_guid": appGUID}, }) if err != nil { return "", nil, err } response := cloudcontroller.Re...
go
func (client *Client) DeleteApplication(appGUID string) (JobURL, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteApplicationRequest, URIParams: internal.Params{"app_guid": appGUID}, }) if err != nil { return "", nil, err } response := cloudcontroller.Re...
[ "func", "(", "client", "*", "Client", ")", "DeleteApplication", "(", "appGUID", "string", ")", "(", "JobURL", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ...
// DeleteApplication deletes the app with the given app GUID. Returns back a // resulting job URL to poll.
[ "DeleteApplication", "deletes", "the", "app", "with", "the", "given", "app", "GUID", ".", "Returns", "back", "a", "resulting", "job", "URL", "to", "poll", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/job_url.go#L14-L27
train
cloudfoundry/cli
api/cloudcontroller/ccv3/job_url.go
UpdateApplicationApplyManifest
func (client *Client) UpdateApplicationApplyManifest(appGUID string, rawManifest []byte) (JobURL, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostApplicationActionApplyManifest, URIParams: map[string]string{"app_guid": appGUID}, Body: bytes.NewReader(ra...
go
func (client *Client) UpdateApplicationApplyManifest(appGUID string, rawManifest []byte) (JobURL, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostApplicationActionApplyManifest, URIParams: map[string]string{"app_guid": appGUID}, Body: bytes.NewReader(ra...
[ "func", "(", "client", "*", "Client", ")", "UpdateApplicationApplyManifest", "(", "appGUID", "string", ",", "rawManifest", "[", "]", "byte", ")", "(", "JobURL", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRe...
// UpdateApplicationApplyManifest applies the manifest to the given // application. Returns back a resulting job URL to poll.
[ "UpdateApplicationApplyManifest", "applies", "the", "manifest", "to", "the", "given", "application", ".", "Returns", "back", "a", "resulting", "job", "URL", "to", "poll", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/job_url.go#L31-L48
train
cloudfoundry/cli
util/ui/i18n.go
GetTranslationFunc
func GetTranslationFunc(reader LocaleReader) (TranslateFunc, error) { locale, err := determineLocale(reader) if err != nil { locale = defaultLocale } rawTranslation, err := loadAssetFromResources(locale) if err != nil { rawTranslation, err = loadAssetFromResources(defaultLocale) if err != nil { return ni...
go
func GetTranslationFunc(reader LocaleReader) (TranslateFunc, error) { locale, err := determineLocale(reader) if err != nil { locale = defaultLocale } rawTranslation, err := loadAssetFromResources(locale) if err != nil { rawTranslation, err = loadAssetFromResources(defaultLocale) if err != nil { return ni...
[ "func", "GetTranslationFunc", "(", "reader", "LocaleReader", ")", "(", "TranslateFunc", ",", "error", ")", "{", "locale", ",", "err", ":=", "determineLocale", "(", "reader", ")", "\n", "if", "err", "!=", "nil", "{", "locale", "=", "defaultLocale", "\n", "}...
// GetTranslationFunc will return back a function that can be used to translate // strings into the currently set locale.
[ "GetTranslationFunc", "will", "return", "back", "a", "function", "that", "can", "be", "used", "to", "translate", "strings", "into", "the", "currently", "set", "locale", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/i18n.go#L48-L63
train
cloudfoundry/cli
integration/helpers/user.go
GetUsers
func GetUsers() []User { var userPagesResponse struct { NextURL *string `json:"next_url"` Resources []struct { Metadata struct { GUID string `json:"guid"` CreatedAt time.Time `json:"created_at"` } `json:"metadata"` Entity struct { Username string `json:"username"` } `json:"entity"...
go
func GetUsers() []User { var userPagesResponse struct { NextURL *string `json:"next_url"` Resources []struct { Metadata struct { GUID string `json:"guid"` CreatedAt time.Time `json:"created_at"` } `json:"metadata"` Entity struct { Username string `json:"username"` } `json:"entity"...
[ "func", "GetUsers", "(", ")", "[", "]", "User", "{", "var", "userPagesResponse", "struct", "{", "NextURL", "*", "string", "`json:\"next_url\"`", "\n", "Resources", "[", "]", "struct", "{", "Metadata", "struct", "{", "GUID", "string", "`json:\"guid\"`", "\n", ...
// GetUsers returns all the users in the targeted environment
[ "GetUsers", "returns", "all", "the", "users", "in", "the", "targeted", "environment" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/user.go#L18-L56
train
cloudfoundry/cli
api/cloudcontroller/ccv3/info.go
rootResponse
func (client *Client) rootResponse() (Info, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ Method: http.MethodGet, URL: client.cloudControllerURL, }) if err != nil { return Info{}, nil, err } var rootResponse Info response := cloudcontroller.Response{ DecodeJSONResponseInto: ...
go
func (client *Client) rootResponse() (Info, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ Method: http.MethodGet, URL: client.cloudControllerURL, }) if err != nil { return Info{}, nil, err } var rootResponse Info response := cloudcontroller.Response{ DecodeJSONResponseInto: ...
[ "func", "(", "client", "*", "Client", ")", "rootResponse", "(", ")", "(", "Info", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "Method", ":", "http", ".", "MethodGet", ...
// rootResponse returns the CC API root document.
[ "rootResponse", "returns", "the", "CC", "API", "root", "document", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/info.go#L135-L155
train
cloudfoundry/cli
api/cloudcontroller/ccv3/application.go
MarshalJSON
func (a Application) MarshalJSON() ([]byte, error) { ccApp := ccApplication{ Name: a.Name, Relationships: a.Relationships, Metadata: a.Metadata, } if a.LifecycleType == constant.AppLifecycleTypeDocker { ccApp.setDockerLifecycle() } else if a.LifecycleType == constant.AppLifecycleTypeBuildpack...
go
func (a Application) MarshalJSON() ([]byte, error) { ccApp := ccApplication{ Name: a.Name, Relationships: a.Relationships, Metadata: a.Metadata, } if a.LifecycleType == constant.AppLifecycleTypeDocker { ccApp.setDockerLifecycle() } else if a.LifecycleType == constant.AppLifecycleTypeBuildpack...
[ "func", "(", "a", "Application", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "ccApp", ":=", "ccApplication", "{", "Name", ":", "a", ".", "Name", ",", "Relationships", ":", "a", ".", "Relationships", ",", "Metadata", "...
// MarshalJSON converts an Application into a Cloud Controller Application.
[ "MarshalJSON", "converts", "an", "Application", "into", "a", "Cloud", "Controller", "Application", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/application.go#L34-L54
train
cloudfoundry/cli
api/cloudcontroller/ccv3/application.go
GetApplications
func (client *Client) GetApplications(query ...Query) ([]Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetApplicationsRequest, Query: query, }) if err != nil { return nil, nil, err } var fullAppsList []Application warnings, err := client.p...
go
func (client *Client) GetApplications(query ...Query) ([]Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetApplicationsRequest, Query: query, }) if err != nil { return nil, nil, err } var fullAppsList []Application warnings, err := client.p...
[ "func", "(", "client", "*", "Client", ")", "GetApplications", "(", "query", "...", "Query", ")", "(", "[", "]", "Application", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "...
// GetApplications lists applications with optional queries.
[ "GetApplications", "lists", "applications", "with", "optional", "queries", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/application.go#L156-L179
train
cloudfoundry/cli
api/cloudcontroller/ccv3/application.go
UpdateApplication
func (client *Client) UpdateApplication(app Application) (Application, Warnings, error) { bodyBytes, err := json.Marshal(app) if err != nil { return Application{}, nil, err } request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PatchApplicationRequest, Body: bytes.NewReader(body...
go
func (client *Client) UpdateApplication(app Application) (Application, Warnings, error) { bodyBytes, err := json.Marshal(app) if err != nil { return Application{}, nil, err } request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PatchApplicationRequest, Body: bytes.NewReader(body...
[ "func", "(", "client", "*", "Client", ")", "UpdateApplication", "(", "app", "Application", ")", "(", "Application", ",", "Warnings", ",", "error", ")", "{", "bodyBytes", ",", "err", ":=", "json", ".", "Marshal", "(", "app", ")", "\n", "if", "err", "!="...
// UpdateApplication updates an application with the given settings.
[ "UpdateApplication", "updates", "an", "application", "with", "the", "given", "settings", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/application.go#L182-L204
train
cloudfoundry/cli
api/cloudcontroller/ccv3/application.go
UpdateApplicationRestart
func (client *Client) UpdateApplicationRestart(appGUID string) (Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostApplicationActionRestartRequest, URIParams: map[string]string{"app_guid": appGUID}, }) if err != nil { return Application{}, nil, err...
go
func (client *Client) UpdateApplicationRestart(appGUID string) (Application, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PostApplicationActionRestartRequest, URIParams: map[string]string{"app_guid": appGUID}, }) if err != nil { return Application{}, nil, err...
[ "func", "(", "client", "*", "Client", ")", "UpdateApplicationRestart", "(", "appGUID", "string", ")", "(", "Application", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "Requ...
// UpdateApplicationRestart restarts the given application.
[ "UpdateApplicationRestart", "restarts", "the", "given", "application", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/application.go#L207-L223
train
cloudfoundry/cli
actor/v2action/application.go
CalculatedBuildpack
func (application Application) CalculatedBuildpack() string { if application.Buildpack.IsSet { return application.Buildpack.Value } return application.DetectedBuildpack.Value }
go
func (application Application) CalculatedBuildpack() string { if application.Buildpack.IsSet { return application.Buildpack.Value } return application.DetectedBuildpack.Value }
[ "func", "(", "application", "Application", ")", "CalculatedBuildpack", "(", ")", "string", "{", "if", "application", ".", "Buildpack", ".", "IsSet", "{", "return", "application", ".", "Buildpack", ".", "Value", "\n", "}", "\n\n", "return", "application", ".", ...
// CalculatedBuildpack returns the buildpack that will be used.
[ "CalculatedBuildpack", "returns", "the", "buildpack", "that", "will", "be", "used", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L25-L31
train
cloudfoundry/cli
actor/v2action/application.go
CalculatedCommand
func (application Application) CalculatedCommand() string { if application.Command.IsSet { return application.Command.Value } return application.DetectedStartCommand.Value }
go
func (application Application) CalculatedCommand() string { if application.Command.IsSet { return application.Command.Value } return application.DetectedStartCommand.Value }
[ "func", "(", "application", "Application", ")", "CalculatedCommand", "(", ")", "string", "{", "if", "application", ".", "Command", ".", "IsSet", "{", "return", "application", ".", "Command", ".", "Value", "\n", "}", "\n\n", "return", "application", ".", "Det...
// CalculatedCommand returns the command that will be used.
[ "CalculatedCommand", "returns", "the", "command", "that", "will", "be", "used", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L34-L40
train
cloudfoundry/cli
actor/v2action/application.go
StagingFailedMessage
func (application Application) StagingFailedMessage() string { if application.StagingFailedDescription != "" { return application.StagingFailedDescription } return application.StagingFailedReason }
go
func (application Application) StagingFailedMessage() string { if application.StagingFailedDescription != "" { return application.StagingFailedDescription } return application.StagingFailedReason }
[ "func", "(", "application", "Application", ")", "StagingFailedMessage", "(", ")", "string", "{", "if", "application", ".", "StagingFailedDescription", "!=", "\"", "\"", "{", "return", "application", ".", "StagingFailedDescription", "\n", "}", "\n\n", "return", "ap...
// StagingFailedMessage returns the verbose description of the failure or // the reason if the verbose description is empty.
[ "StagingFailedMessage", "returns", "the", "verbose", "description", "of", "the", "failure", "or", "the", "reason", "if", "the", "verbose", "description", "is", "empty", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/application.go#L64-L70
train