id int32 0 167k | 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 listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
26,000 | cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | GetRoutes | func (client *Client) GetRoutes(filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRoutesRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullRoutesList []Route
warnings, err := ... | go | func (client *Client) GetRoutes(filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetRoutesRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullRoutesList []Route
warnings, err := ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetRoutes",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Route",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Re... | // GetRoutes returns a list of Routes based off of the provided filters. | [
"GetRoutes",
"returns",
"a",
"list",
"of",
"Routes",
"based",
"off",
"of",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L227-L250 |
26,001 | cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | GetSpaceRoutes | func (client *Client) GetSpaceRoutes(spaceGUID string, filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceRoutesRequest,
URIParams: map[string]string{"space_guid": spaceGUID},
Query: ConvertFilterParameters(filters),
})
if... | go | func (client *Client) GetSpaceRoutes(spaceGUID string, filters ...Filter) ([]Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSpaceRoutesRequest,
URIParams: map[string]string{"space_guid": spaceGUID},
Query: ConvertFilterParameters(filters),
})
if... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceRoutes",
"(",
"spaceGUID",
"string",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Route",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
... | // GetSpaceRoutes returns a list of Routes associated with the provided Space
// GUID, and filtered by the provided filters. | [
"GetSpaceRoutes",
"returns",
"a",
"list",
"of",
"Routes",
"associated",
"with",
"the",
"provided",
"Space",
"GUID",
"and",
"filtered",
"by",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L254-L278 |
26,002 | cloudfoundry/cli | api/cloudcontroller/ccv2/route.go | UpdateRouteApplication | func (client *Client) UpdateRouteApplication(routeGUID string, appGUID string) (Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutRouteAppRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"route_guid": routeGUID,
},
})
if err != nil {
r... | go | func (client *Client) UpdateRouteApplication(routeGUID string, appGUID string) (Route, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutRouteAppRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"route_guid": routeGUID,
},
})
if err != nil {
r... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateRouteApplication",
"(",
"routeGUID",
"string",
",",
"appGUID",
"string",
")",
"(",
"Route",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"reque... | // UpdateRouteApplication creates a link between the route and application. | [
"UpdateRouteApplication",
"creates",
"a",
"link",
"between",
"the",
"route",
"and",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/route.go#L281-L300 |
26,003 | cloudfoundry/cli | api/cloudcontroller/ccv3/process.go | CreateApplicationProcessScale | func (client *Client) CreateApplicationProcessScale(appGUID string, process Process) (Process, Warnings, error) {
body, err := json.Marshal(process)
if err != nil {
return Process{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationProcessActionScaleRequest,... | go | func (client *Client) CreateApplicationProcessScale(appGUID string, process Process) (Process, Warnings, error) {
body, err := json.Marshal(process)
if err != nil {
return Process{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationProcessActionScaleRequest,... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateApplicationProcessScale",
"(",
"appGUID",
"string",
",",
"process",
"Process",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"process",... | // CreateApplicationProcessScale updates process instances count, memory or disk | [
"CreateApplicationProcessScale",
"updates",
"process",
"instances",
"count",
"memory",
"or",
"disk"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process.go#L81-L102 |
26,004 | cloudfoundry/cli | api/cloudcontroller/ccv3/process.go | GetApplicationProcessByType | func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationProcessRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"type": processType,
},
})
if... | go | func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationProcessRequest,
URIParams: map[string]string{
"app_guid": appGUID,
"type": processType,
},
})
if... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetApplicationProcessByType",
"(",
"appGUID",
"string",
",",
"processType",
"string",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",... | // GetApplicationProcessByType returns application process of specified type | [
"GetApplicationProcessByType",
"returns",
"application",
"process",
"of",
"specified",
"type"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process.go#L105-L123 |
26,005 | cloudfoundry/cli | api/cloudcontroller/ccv3/process.go | UpdateProcess | func (client *Client) UpdateProcess(process Process) (Process, Warnings, error) {
body, err := json.Marshal(Process{
Command: process.Command,
HealthCheckType: process.HealthCheckType,
HealthCheckEndpoint: process.HealthCheckEndpoint,
HealthCheckTimeout: pro... | go | func (client *Client) UpdateProcess(process Process) (Process, Warnings, error) {
body, err := json.Marshal(Process{
Command: process.Command,
HealthCheckType: process.HealthCheckType,
HealthCheckEndpoint: process.HealthCheckEndpoint,
HealthCheckTimeout: pro... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateProcess",
"(",
"process",
"Process",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"Process",
"{",
"Command",
":",
"process",
".",
... | // UpdateProcess updates the process's command or health check settings. GUID
// is always required; HealthCheckType is only required when updating health
// check settings. | [
"UpdateProcess",
"updates",
"the",
"process",
"s",
"command",
"or",
"health",
"check",
"settings",
".",
"GUID",
"is",
"always",
"required",
";",
"HealthCheckType",
"is",
"only",
"required",
"when",
"updating",
"health",
"check",
"settings",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/process.go#L155-L182 |
26,006 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance_shared_to.go | GetServiceInstanceSharedTos | func (client *Client) GetServiceInstanceSharedTos(serviceInstanceGUID string) ([]ServiceInstanceSharedTo, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceSharedToRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err... | go | func (client *Client) GetServiceInstanceSharedTos(serviceInstanceGUID string) ([]ServiceInstanceSharedTo, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceSharedToRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetServiceInstanceSharedTos",
"(",
"serviceInstanceGUID",
"string",
")",
"(",
"[",
"]",
"ServiceInstanceSharedTo",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
... | // GetServiceInstanceSharedTos returns a list of ServiceInstanceSharedTo objects. | [
"GetServiceInstanceSharedTos",
"returns",
"a",
"list",
"of",
"ServiceInstanceSharedTo",
"objects",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance_shared_to.go#L29-L53 |
26,007 | cloudfoundry/cli | api/uaa/uaa_connection.go | NewConnection | func NewConnection(skipSSLValidation bool, disableKeepAlives bool, dialTimeout time.Duration) *UAAConnection {
tr := &http.Transport{
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: dialTimeout,
}).DialContext,
DisableKeepAlives: disableKeepAlives,
Proxy: http.ProxyFromEnvi... | go | func NewConnection(skipSSLValidation bool, disableKeepAlives bool, dialTimeout time.Duration) *UAAConnection {
tr := &http.Transport{
DialContext: (&net.Dialer{
KeepAlive: 30 * time.Second,
Timeout: dialTimeout,
}).DialContext,
DisableKeepAlives: disableKeepAlives,
Proxy: http.ProxyFromEnvi... | [
"func",
"NewConnection",
"(",
"skipSSLValidation",
"bool",
",",
"disableKeepAlives",
"bool",
",",
"dialTimeout",
"time",
".",
"Duration",
")",
"*",
"UAAConnection",
"{",
"tr",
":=",
"&",
"http",
".",
"Transport",
"{",
"DialContext",
":",
"(",
"&",
"net",
"."... | // NewConnection returns a pointer to a new UAA Connection | [
"NewConnection",
"returns",
"a",
"pointer",
"to",
"a",
"new",
"UAA",
"Connection"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/uaa_connection.go#L21-L45 |
26,008 | cloudfoundry/cli | api/uaa/uaa_connection.go | Make | func (connection *UAAConnection) Make(request *http.Request, passedResponse *Response) error {
// In case this function is called from a retry, passedResponse may already
// be populated with a previous response. We reset in case there's an HTTP
// error and we don't repopulate it in populateResponse.
passedRespons... | go | func (connection *UAAConnection) Make(request *http.Request, passedResponse *Response) error {
// In case this function is called from a retry, passedResponse may already
// be populated with a previous response. We reset in case there's an HTTP
// error and we don't repopulate it in populateResponse.
passedRespons... | [
"func",
"(",
"connection",
"*",
"UAAConnection",
")",
"Make",
"(",
"request",
"*",
"http",
".",
"Request",
",",
"passedResponse",
"*",
"Response",
")",
"error",
"{",
"// In case this function is called from a retry, passedResponse may already",
"// be populated with a previ... | // Make takes a passedRequest, converts it into an HTTP request and then
// executes it. The response is then injected into passedResponse. | [
"Make",
"takes",
"a",
"passedRequest",
"converts",
"it",
"into",
"an",
"HTTP",
"request",
"and",
"then",
"executes",
"it",
".",
"The",
"response",
"is",
"then",
"injected",
"into",
"passedResponse",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/uaa_connection.go#L49-L61 |
26,009 | cloudfoundry/cli | api/cloudcontroller/ccv2/event.go | UnmarshalJSON | func (event *Event) UnmarshalJSON(data []byte) error {
var ccEvent struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Type string `json:"type,omitempty"`
ActorGUID string `json:"actor,omitempty"`
ActorType string `json:"actor_type,o... | go | func (event *Event) UnmarshalJSON(data []byte) error {
var ccEvent struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Type string `json:"type,omitempty"`
ActorGUID string `json:"actor,omitempty"`
ActorType string `json:"actor_type,o... | [
"func",
"(",
"event",
"*",
"Event",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccEvent",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Type",
"string",
"`... | // UnmarshalJSON helps unmarshal a Cloud Controller Event response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Event",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/event.go#L46-L81 |
26,010 | cloudfoundry/cli | api/cloudcontroller/ccv2/event.go | GetEvents | func (client *Client) GetEvents(filters ...Filter) ([]Event, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetEventsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullEventsList []Event
warnings, err := ... | go | func (client *Client) GetEvents(filters ...Filter) ([]Event, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetEventsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var fullEventsList []Event
warnings, err := ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetEvents",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Event",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Re... | // GetEvents returns back a list of Events based off of the provided queries. | [
"GetEvents",
"returns",
"back",
"a",
"list",
"of",
"Events",
"based",
"off",
"of",
"the",
"provided",
"queries",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/event.go#L84-L107 |
26,011 | cloudfoundry/cli | api/cloudcontroller/ccv3/v2_formatted_resource.go | UnmarshalJSON | func (r *V2FormattedResource) UnmarshalJSON(data []byte) error {
var ccResource struct {
Filename string `json:"fn,omitempty"`
Mode string `json:"mode,omitempty"`
SHA1 string `json:"sha1"`
Size int64 `json:"size"`
}
err := cloudcontroller.DecodeJSON(data, &ccResource)
if err != nil {
return ... | go | func (r *V2FormattedResource) UnmarshalJSON(data []byte) error {
var ccResource struct {
Filename string `json:"fn,omitempty"`
Mode string `json:"mode,omitempty"`
SHA1 string `json:"sha1"`
Size int64 `json:"size"`
}
err := cloudcontroller.DecodeJSON(data, &ccResource)
if err != nil {
return ... | [
"func",
"(",
"r",
"*",
"V2FormattedResource",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccResource",
"struct",
"{",
"Filename",
"string",
"`json:\"fn,omitempty\"`",
"\n",
"Mode",
"string",
"`json:\"mode,omitempty\"`",
"\n",
... | // UnmarshalJSON helps unmarshal a Cloud Controller V2FormattedResource response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"V2FormattedResource",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/v2_formatted_resource.go#L50-L73 |
26,012 | cloudfoundry/cli | api/uaa/auth.go | Authenticate | func (client Client) Authenticate(creds map[string]string, origin string, grantType constant.GrantType) (string, string, error) {
requestBody := url.Values{
"grant_type": {string(grantType)},
}
for k, v := range creds {
requestBody.Set(k, v)
}
type loginHint struct {
Origin string `json:"origin"`
}
orig... | go | func (client Client) Authenticate(creds map[string]string, origin string, grantType constant.GrantType) (string, string, error) {
requestBody := url.Values{
"grant_type": {string(grantType)},
}
for k, v := range creds {
requestBody.Set(k, v)
}
type loginHint struct {
Origin string `json:"origin"`
}
orig... | [
"func",
"(",
"client",
"Client",
")",
"Authenticate",
"(",
"creds",
"map",
"[",
"string",
"]",
"string",
",",
"origin",
"string",
",",
"grantType",
"constant",
".",
"GrantType",
")",
"(",
"string",
",",
"string",
",",
"error",
")",
"{",
"requestBody",
":... | // Authenticate sends a username and password to UAA then returns an access
// token and a refresh token. | [
"Authenticate",
"sends",
"a",
"username",
"and",
"password",
"to",
"UAA",
"then",
"returns",
"an",
"access",
"token",
"and",
"a",
"refresh",
"token",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/auth.go#L22-L72 |
26,013 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization_quota.go | UnmarshalJSON | func (application *OrganizationQuota) UnmarshalJSON(data []byte) error {
var ccOrgQuota struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
} `json:"entity"`
}
err := cloudcontroller.DecodeJSON(data, &ccOrgQuota)
if err != nil {
return err
}
application.GU... | go | func (application *OrganizationQuota) UnmarshalJSON(data []byte) error {
var ccOrgQuota struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
} `json:"entity"`
}
err := cloudcontroller.DecodeJSON(data, &ccOrgQuota)
if err != nil {
return err
}
application.GU... | [
"func",
"(",
"application",
"*",
"OrganizationQuota",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccOrgQuota",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Na... | // UnmarshalJSON helps unmarshal a Cloud Controller organization quota response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"organization",
"quota",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization_quota.go#L20-L36 |
26,014 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization_quota.go | GetOrganizationQuota | func (client *Client) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionRequest,
URIParams: Params{"organization_quota_guid": guid},
})
if err != nil {
return OrganizationQuota{}, ... | go | func (client *Client) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionRequest,
URIParams: Params{"organization_quota_guid": guid},
})
if err != nil {
return OrganizationQuota{}, ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetOrganizationQuota",
"(",
"guid",
"string",
")",
"(",
"OrganizationQuota",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Reque... | // GetOrganizationQuota returns an Organization Quota associated with the
// provided GUID. | [
"GetOrganizationQuota",
"returns",
"an",
"Organization",
"Quota",
"associated",
"with",
"the",
"provided",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization_quota.go#L40-L56 |
26,015 | cloudfoundry/cli | api/cloudcontroller/ccv2/organization_quota.go | GetOrganizationQuotas | func (client *Client) GetOrganizationQuotas(filters ...Filter) ([]OrganizationQuota, Warnings, error) {
allQueries := ConvertFilterParameters(filters)
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionsRequest,
Query: allQueries,
})
if err != nil {
... | go | func (client *Client) GetOrganizationQuotas(filters ...Filter) ([]OrganizationQuota, Warnings, error) {
allQueries := ConvertFilterParameters(filters)
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetOrganizationQuotaDefinitionsRequest,
Query: allQueries,
})
if err != nil {
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetOrganizationQuotas",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"OrganizationQuota",
",",
"Warnings",
",",
"error",
")",
"{",
"allQueries",
":=",
"ConvertFilterParameters",
"(",
"filters",
")",
"\n",
"... | // GetOrganizationQuotas returns an Organization Quota list associated with the
// provided filters. | [
"GetOrganizationQuotas",
"returns",
"an",
"Organization",
"Quota",
"list",
"associated",
"with",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/organization_quota.go#L60-L86 |
26,016 | cloudfoundry/cli | actor/v7action/process.go | GetProcessByTypeAndApplication | func (actor Actor) GetProcessByTypeAndApplication(processType string, appGUID string) (Process, Warnings, error) {
process, warnings, err := actor.CloudControllerClient.GetApplicationProcessByType(appGUID, processType)
if _, ok := err.(ccerror.ProcessNotFoundError); ok {
return Process{}, Warnings(warnings), action... | go | func (actor Actor) GetProcessByTypeAndApplication(processType string, appGUID string) (Process, Warnings, error) {
process, warnings, err := actor.CloudControllerClient.GetApplicationProcessByType(appGUID, processType)
if _, ok := err.(ccerror.ProcessNotFoundError); ok {
return Process{}, Warnings(warnings), action... | [
"func",
"(",
"actor",
"Actor",
")",
"GetProcessByTypeAndApplication",
"(",
"processType",
"string",
",",
"appGUID",
"string",
")",
"(",
"Process",
",",
"Warnings",
",",
"error",
")",
"{",
"process",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudCont... | // GetProcessByTypeAndApplication returns a process for the given application
// and type. | [
"GetProcessByTypeAndApplication",
"returns",
"a",
"process",
"for",
"the",
"given",
"application",
"and",
"type",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/process.go#L15-L21 |
26,017 | cloudfoundry/cli | types/filtered_string.go | ParseValue | func (n *FilteredString) ParseValue(val string) {
if val == "" {
n.IsSet = false
n.Value = ""
return
}
n.IsSet = true
switch val {
case "null", "default":
n.Value = ""
default:
n.Value = val
}
} | go | func (n *FilteredString) ParseValue(val string) {
if val == "" {
n.IsSet = false
n.Value = ""
return
}
n.IsSet = true
switch val {
case "null", "default":
n.Value = ""
default:
n.Value = val
}
} | [
"func",
"(",
"n",
"*",
"FilteredString",
")",
"ParseValue",
"(",
"val",
"string",
")",
"{",
"if",
"val",
"==",
"\"",
"\"",
"{",
"n",
".",
"IsSet",
"=",
"false",
"\n",
"n",
".",
"Value",
"=",
"\"",
"\"",
"\n",
"return",
"\n",
"}",
"\n\n",
"n",
"... | // ParseValue is used to parse a user provided flag argument. | [
"ParseValue",
"is",
"used",
"to",
"parse",
"a",
"user",
"provided",
"flag",
"argument",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/types/filtered_string.go#L27-L42 |
26,018 | cloudfoundry/cli | types/filtered_string.go | MarshalJSON | func (n FilteredString) MarshalJSON() ([]byte, error) {
if n.Value != "" {
return json.Marshal(n.Value)
}
return json.Marshal(new(json.RawMessage))
} | go | func (n FilteredString) MarshalJSON() ([]byte, error) {
if n.Value != "" {
return json.Marshal(n.Value)
}
return json.Marshal(new(json.RawMessage))
} | [
"func",
"(",
"n",
"FilteredString",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"n",
".",
"Value",
"!=",
"\"",
"\"",
"{",
"return",
"json",
".",
"Marshal",
"(",
"n",
".",
"Value",
")",
"\n",
"}",
"\n\n",
"... | // MarshalJSON marshals the value field if it's not empty, otherwise returns an
// null. | [
"MarshalJSON",
"marshals",
"the",
"value",
"field",
"if",
"it",
"s",
"not",
"empty",
"otherwise",
"returns",
"an",
"null",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/types/filtered_string.go#L68-L74 |
26,019 | cloudfoundry/cli | api/cloudcontroller/decode_json.go | DecodeJSON | func DecodeJSON(raw []byte, v interface{}) error {
decoder := json.NewDecoder(bytes.NewBuffer(raw))
decoder.UseNumber()
return decoder.Decode(v)
} | go | func DecodeJSON(raw []byte, v interface{}) error {
decoder := json.NewDecoder(bytes.NewBuffer(raw))
decoder.UseNumber()
return decoder.Decode(v)
} | [
"func",
"DecodeJSON",
"(",
"raw",
"[",
"]",
"byte",
",",
"v",
"interface",
"{",
"}",
")",
"error",
"{",
"decoder",
":=",
"json",
".",
"NewDecoder",
"(",
"bytes",
".",
"NewBuffer",
"(",
"raw",
")",
")",
"\n",
"decoder",
".",
"UseNumber",
"(",
")",
"... | // DecodeJSON unmarshals JSON into the given object with the appropriate
// settings. | [
"DecodeJSON",
"unmarshals",
"JSON",
"into",
"the",
"given",
"object",
"with",
"the",
"appropriate",
"settings",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/decode_json.go#L10-L14 |
26,020 | cloudfoundry/cli | api/cloudcontroller/ccv3/deployment.go | MarshalJSON | func (d Deployment) MarshalJSON() ([]byte, error) {
type Droplet struct {
GUID string `json:"guid,omitempty"`
}
var ccDeployment struct {
Droplet *Droplet `json:"droplet,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
}
if d.DropletGUID != "" {
ccDeployment.Droplet = &... | go | func (d Deployment) MarshalJSON() ([]byte, error) {
type Droplet struct {
GUID string `json:"guid,omitempty"`
}
var ccDeployment struct {
Droplet *Droplet `json:"droplet,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
}
if d.DropletGUID != "" {
ccDeployment.Droplet = &... | [
"func",
"(",
"d",
"Deployment",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"type",
"Droplet",
"struct",
"{",
"GUID",
"string",
"`json:\"guid,omitempty\"`",
"\n",
"}",
"\n\n",
"var",
"ccDeployment",
"struct",
"{",
"Droplet"... | // MarshalJSON converts a Deployment into a Cloud Controller Deployment. | [
"MarshalJSON",
"converts",
"a",
"Deployment",
"into",
"a",
"Cloud",
"Controller",
"Deployment",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/deployment.go#L23-L40 |
26,021 | cloudfoundry/cli | api/cloudcontroller/ccv3/deployment.go | UnmarshalJSON | func (d *Deployment) UnmarshalJSON(data []byte) error {
var ccDeployment struct {
GUID string `json:"guid,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
State constant.De... | go | func (d *Deployment) UnmarshalJSON(data []byte) error {
var ccDeployment struct {
GUID string `json:"guid,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Relationships Relationships `json:"relationships,omitempty"`
State constant.De... | [
"func",
"(",
"d",
"*",
"Deployment",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccDeployment",
"struct",
"{",
"GUID",
"string",
"`json:\"guid,omitempty\"`",
"\n",
"CreatedAt",
"string",
"`json:\"created_at,omitempty\"`",
"\n",
... | // UnmarshalJSON helps unmarshal a Cloud Controller Deployment response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Deployment",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/deployment.go#L43-L63 |
26,022 | cloudfoundry/cli | integration/helpers/environment.go | CheckEnvironmentTargetedCorrectly | func CheckEnvironmentTargetedCorrectly(targetedOrganizationRequired bool, targetedSpaceRequired bool, testOrg string, command ...string) {
LoginCF()
if targetedOrganizationRequired {
By("errors if org is not targeted")
session := CF(command...)
Eventually(session).Should(Say("FAILED"))
Eventually(session.Err... | go | func CheckEnvironmentTargetedCorrectly(targetedOrganizationRequired bool, targetedSpaceRequired bool, testOrg string, command ...string) {
LoginCF()
if targetedOrganizationRequired {
By("errors if org is not targeted")
session := CF(command...)
Eventually(session).Should(Say("FAILED"))
Eventually(session.Err... | [
"func",
"CheckEnvironmentTargetedCorrectly",
"(",
"targetedOrganizationRequired",
"bool",
",",
"targetedSpaceRequired",
"bool",
",",
"testOrg",
"string",
",",
"command",
"...",
"string",
")",
"{",
"LoginCF",
"(",
")",
"\n\n",
"if",
"targetedOrganizationRequired",
"{",
... | // CheckEnvironmentTargetedCorrectly will confirm if the command requires an
// API to be targeted and logged in to run. It can optionally check if the
// command requires org and space to be targeted. | [
"CheckEnvironmentTargetedCorrectly",
"will",
"confirm",
"if",
"the",
"command",
"requires",
"an",
"API",
"to",
"be",
"targeted",
"and",
"logged",
"in",
"to",
"run",
".",
"It",
"can",
"optionally",
"check",
"if",
"the",
"command",
"requires",
"org",
"and",
"spa... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/environment.go#L32-L65 |
26,023 | cloudfoundry/cli | util/manifest/manifest.go | ReadAndInterpolateManifest | func ReadAndInterpolateManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]Application, error) {
rawManifest, err := ReadAndInterpolateRawManifest(pathToManifest, pathsToVarsFiles, vars)
if err != nil {
return nil, err
}
var manifest Manifest
err = yaml.Unmarshal(rawManifest, &m... | go | func ReadAndInterpolateManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]Application, error) {
rawManifest, err := ReadAndInterpolateRawManifest(pathToManifest, pathsToVarsFiles, vars)
if err != nil {
return nil, err
}
var manifest Manifest
err = yaml.Unmarshal(rawManifest, &m... | [
"func",
"ReadAndInterpolateManifest",
"(",
"pathToManifest",
"string",
",",
"pathsToVarsFiles",
"[",
"]",
"string",
",",
"vars",
"[",
"]",
"template",
".",
"VarKV",
")",
"(",
"[",
"]",
"Application",
",",
"error",
")",
"{",
"rawManifest",
",",
"err",
":=",
... | // ReadAndInterpolateManifest reads the manifest at the provided paths,
// interpolates variables if a vars file is provided, and returns a fully
// merged set of applications. | [
"ReadAndInterpolateManifest",
"reads",
"the",
"manifest",
"at",
"the",
"provided",
"paths",
"interpolates",
"variables",
"if",
"a",
"vars",
"file",
"is",
"provided",
"and",
"returns",
"a",
"fully",
"merged",
"set",
"of",
"applications",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/manifest/manifest.go#L37-L56 |
26,024 | cloudfoundry/cli | util/manifest/manifest.go | ReadAndInterpolateRawManifest | func ReadAndInterpolateRawManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]byte, error) {
rawManifest, err := ioutil.ReadFile(pathToManifest)
if err != nil {
return nil, err
}
tpl := template.NewTemplate(rawManifest)
fileVars := template.StaticVariables{}
for _, path := ran... | go | func ReadAndInterpolateRawManifest(pathToManifest string, pathsToVarsFiles []string, vars []template.VarKV) ([]byte, error) {
rawManifest, err := ioutil.ReadFile(pathToManifest)
if err != nil {
return nil, err
}
tpl := template.NewTemplate(rawManifest)
fileVars := template.StaticVariables{}
for _, path := ran... | [
"func",
"ReadAndInterpolateRawManifest",
"(",
"pathToManifest",
"string",
",",
"pathsToVarsFiles",
"[",
"]",
"string",
",",
"vars",
"[",
"]",
"template",
".",
"VarKV",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"rawManifest",
",",
"err",
":=",
"io... | // ReadAndInterpolateRawManifest reads the manifest at the provided paths,
// interpolates variables if a vars file is provided, and returns the
// Unmarshalled result. | [
"ReadAndInterpolateRawManifest",
"reads",
"the",
"manifest",
"at",
"the",
"provided",
"paths",
"interpolates",
"variables",
"if",
"a",
"vars",
"file",
"is",
"provided",
"and",
"returns",
"the",
"Unmarshalled",
"result",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/manifest/manifest.go#L61-L97 |
26,025 | cloudfoundry/cli | util/manifest/manifest.go | WriteApplicationManifest | func WriteApplicationManifest(application Application, filePath string) error {
manifest := Manifest{Applications: []Application{application}}
manifestBytes, err := yaml.Marshal(manifest)
if err != nil {
return ManifestCreationError{Err: err}
}
err = ioutil.WriteFile(filePath, manifestBytes, 0644)
if err != ni... | go | func WriteApplicationManifest(application Application, filePath string) error {
manifest := Manifest{Applications: []Application{application}}
manifestBytes, err := yaml.Marshal(manifest)
if err != nil {
return ManifestCreationError{Err: err}
}
err = ioutil.WriteFile(filePath, manifestBytes, 0644)
if err != ni... | [
"func",
"WriteApplicationManifest",
"(",
"application",
"Application",
",",
"filePath",
"string",
")",
"error",
"{",
"manifest",
":=",
"Manifest",
"{",
"Applications",
":",
"[",
"]",
"Application",
"{",
"application",
"}",
"}",
"\n",
"manifestBytes",
",",
"err",... | // WriteApplicationManifest writes the provided application to the given
// filepath. If the filepath does not exist, it will create it. | [
"WriteApplicationManifest",
"writes",
"the",
"provided",
"application",
"to",
"the",
"given",
"filepath",
".",
"If",
"the",
"filepath",
"does",
"not",
"exist",
"it",
"will",
"create",
"it",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/manifest/manifest.go#L101-L114 |
26,026 | cloudfoundry/cli | api/cloudcontroller/ccv3/isolation_segment.go | GetIsolationSegment | func (client *Client) GetIsolationSegment(guid string) (IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentRequest,
URIParams: map[string]string{"isolation_segment_guid": guid},
})
if err != nil {
return IsolationSegment{}, nil,... | go | func (client *Client) GetIsolationSegment(guid string) (IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentRequest,
URIParams: map[string]string{"isolation_segment_guid": guid},
})
if err != nil {
return IsolationSegment{}, nil,... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetIsolationSegment",
"(",
"guid",
"string",
")",
"(",
"IsolationSegment",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"Request... | // GetIsolationSegment returns back the requested isolation segment that
// matches the GUID. | [
"GetIsolationSegment",
"returns",
"back",
"the",
"requested",
"isolation",
"segment",
"that",
"matches",
"the",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/isolation_segment.go#L65-L84 |
26,027 | cloudfoundry/cli | api/cloudcontroller/ccv3/isolation_segment.go | GetIsolationSegments | func (client *Client) GetIsolationSegments(query ...Query) ([]IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentsRequest,
Query: query,
})
if err != nil {
return nil, nil, err
}
var fullIsolationSegmentsList []IsolationS... | go | func (client *Client) GetIsolationSegments(query ...Query) ([]IsolationSegment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetIsolationSegmentsRequest,
Query: query,
})
if err != nil {
return nil, nil, err
}
var fullIsolationSegmentsList []IsolationS... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetIsolationSegments",
"(",
"query",
"...",
"Query",
")",
"(",
"[",
"]",
"IsolationSegment",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOpt... | // GetIsolationSegments lists isolation segments with optional filters. | [
"GetIsolationSegments",
"lists",
"isolation",
"segments",
"with",
"optional",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/isolation_segment.go#L87-L110 |
26,028 | cloudfoundry/cli | api/cloudcontroller/buildpacks/upload.go | CalculateRequestSize | func CalculateRequestSize(buildpackSize int64, bpPath string, fieldName string) (int64, error) {
body := &bytes.Buffer{}
form := multipart.NewWriter(body)
bpFileName := filepath.Base(bpPath)
_, err := form.CreateFormFile(fieldName, bpFileName)
if err != nil {
return 0, err
}
err = form.Close()
if err != ni... | go | func CalculateRequestSize(buildpackSize int64, bpPath string, fieldName string) (int64, error) {
body := &bytes.Buffer{}
form := multipart.NewWriter(body)
bpFileName := filepath.Base(bpPath)
_, err := form.CreateFormFile(fieldName, bpFileName)
if err != nil {
return 0, err
}
err = form.Close()
if err != ni... | [
"func",
"CalculateRequestSize",
"(",
"buildpackSize",
"int64",
",",
"bpPath",
"string",
",",
"fieldName",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"body",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"form",
":=",
"multipart",
".",
"New... | // tested via the ccv2.buildpack_test.go file at this point | [
"tested",
"via",
"the",
"ccv2",
".",
"buildpack_test",
".",
"go",
"file",
"at",
"this",
"point"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/buildpacks/upload.go#L14-L31 |
26,029 | cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | UnmarshalJSON | func (securityGroup *SecurityGroup) UnmarshalJSON(data []byte) error {
var ccSecurityGroup struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
GUID string `json:"guid"`
Name string `json:"name"`
Rules []struct {
Description string `json:"description"`
Destination string `json... | go | func (securityGroup *SecurityGroup) UnmarshalJSON(data []byte) error {
var ccSecurityGroup struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
GUID string `json:"guid"`
Name string `json:"name"`
Rules []struct {
Description string `json:"description"`
Destination string `json... | [
"func",
"(",
"securityGroup",
"*",
"SecurityGroup",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccSecurityGroup",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
... | // UnmarshalJSON helps unmarshal a Cloud Controller Security Group response | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Security",
"Group",
"response"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L26-L59 |
26,030 | cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | DeleteSecurityGroupSpace | func (client *Client) DeleteSecurityGroupSpace(securityGroupGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteSecurityGroupSpaceRequest,
URIParams: Params{
"security_group_guid": securityGroupGUID,
"space_guid": space... | go | func (client *Client) DeleteSecurityGroupSpace(securityGroupGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteSecurityGroupSpaceRequest,
URIParams: Params{
"security_group_guid": securityGroupGUID,
"space_guid": space... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteSecurityGroupSpace",
"(",
"securityGroupGUID",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOpti... | // DeleteSecurityGroupSpace disassociates a security group in the running phase
// for the lifecycle, specified by its GUID, from a space, which is also
// specified by its GUID. | [
"DeleteSecurityGroupSpace",
"disassociates",
"a",
"security",
"group",
"in",
"the",
"running",
"phase",
"for",
"the",
"lifecycle",
"specified",
"by",
"its",
"GUID",
"from",
"a",
"space",
"which",
"is",
"also",
"specified",
"by",
"its",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L64-L81 |
26,031 | cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | GetSecurityGroups | func (client *Client) GetSecurityGroups(filters ...Filter) ([]SecurityGroup, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSecurityGroupsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var securityGroupsLi... | go | func (client *Client) GetSecurityGroups(filters ...Filter) ([]SecurityGroup, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetSecurityGroupsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var securityGroupsLi... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSecurityGroups",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOption... | // GetSecurityGroups returns a list of Security Groups based off the provided
// filters. | [
"GetSecurityGroups",
"returns",
"a",
"list",
"of",
"Security",
"Groups",
"based",
"off",
"the",
"provided",
"filters",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L107-L131 |
26,032 | cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | GetSpaceSecurityGroups | func (client *Client) GetSpaceSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceSecurityGroupsRequest, filters)
} | go | func (client *Client) GetSpaceSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceSecurityGroupsRequest, filters)
} | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceSecurityGroups",
"(",
"spaceGUID",
"string",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"return",
"client",
".",
"getSpaceSecurityGroupsBySp... | // GetSpaceSecurityGroups returns the running Security Groups associated with
// the provided Space GUID. | [
"GetSpaceSecurityGroups",
"returns",
"the",
"running",
"Security",
"Groups",
"associated",
"with",
"the",
"provided",
"Space",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L135-L137 |
26,033 | cloudfoundry/cli | api/cloudcontroller/ccv2/security_group.go | GetSpaceStagingSecurityGroups | func (client *Client) GetSpaceStagingSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceStagingSecurityGroupsRequest, filters)
} | go | func (client *Client) GetSpaceStagingSecurityGroups(spaceGUID string, filters ...Filter) ([]SecurityGroup, Warnings, error) {
return client.getSpaceSecurityGroupsBySpaceAndLifecycle(spaceGUID, internal.GetSpaceStagingSecurityGroupsRequest, filters)
} | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceStagingSecurityGroups",
"(",
"spaceGUID",
"string",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"return",
"client",
".",
"getSpaceSecurityGro... | // GetSpaceStagingSecurityGroups returns the staging Security Groups
// associated with the provided Space GUID. | [
"GetSpaceStagingSecurityGroups",
"returns",
"the",
"staging",
"Security",
"Groups",
"associated",
"with",
"the",
"provided",
"Space",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/security_group.go#L141-L143 |
26,034 | cloudfoundry/cli | api/cloudcontroller/ccv3/job.go | Errors | func (job Job) Errors() []error {
var errs []error
for _, errDetails := range job.RawErrors {
switch errDetails.Code {
case constant.JobErrorCodeBuildpackAlreadyExistsForStack:
errs = append(errs, ccerror.BuildpackAlreadyExistsForStackError{Message: errDetails.Detail})
case constant.JobErrorCodeBuildpackAlre... | go | func (job Job) Errors() []error {
var errs []error
for _, errDetails := range job.RawErrors {
switch errDetails.Code {
case constant.JobErrorCodeBuildpackAlreadyExistsForStack:
errs = append(errs, ccerror.BuildpackAlreadyExistsForStackError{Message: errDetails.Detail})
case constant.JobErrorCodeBuildpackAlre... | [
"func",
"(",
"job",
"Job",
")",
"Errors",
"(",
")",
"[",
"]",
"error",
"{",
"var",
"errs",
"[",
"]",
"error",
"\n",
"for",
"_",
",",
"errDetails",
":=",
"range",
"job",
".",
"RawErrors",
"{",
"switch",
"errDetails",
".",
"Code",
"{",
"case",
"const... | // Errors returns back a list of | [
"Errors",
"returns",
"back",
"a",
"list",
"of"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/job.go#L22-L46 |
26,035 | cloudfoundry/cli | actor/v7action/application.go | CreateApplicationInSpace | func (actor Actor) CreateApplicationInSpace(app Application, spaceGUID string) (Application, Warnings, error) {
createdApp, warnings, err := actor.CloudControllerClient.CreateApplication(
ccv3.Application{
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
StackName: ... | go | func (actor Actor) CreateApplicationInSpace(app Application, spaceGUID string) (Application, Warnings, error) {
createdApp, warnings, err := actor.CloudControllerClient.CreateApplication(
ccv3.Application{
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
StackName: ... | [
"func",
"(",
"actor",
"Actor",
")",
"CreateApplicationInSpace",
"(",
"app",
"Application",
",",
"spaceGUID",
"string",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"createdApp",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudCont... | // CreateApplicationInSpace creates and returns the application with the given
// name in the given space. | [
"CreateApplicationInSpace",
"creates",
"and",
"returns",
"the",
"application",
"with",
"the",
"given",
"name",
"in",
"the",
"given",
"space",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L106-L126 |
26,036 | cloudfoundry/cli | actor/v7action/application.go | SetApplicationProcessHealthCheckTypeByNameAndSpace | func (actor Actor) SetApplicationProcessHealthCheckTypeByNameAndSpace(
appName string,
spaceGUID string,
healthCheckType constant.HealthCheckType,
httpEndpoint string,
processType string,
invocationTimeout int64,
) (Application, Warnings, error) {
app, getWarnings, err := actor.GetApplicationByNameAndSpace(appN... | go | func (actor Actor) SetApplicationProcessHealthCheckTypeByNameAndSpace(
appName string,
spaceGUID string,
healthCheckType constant.HealthCheckType,
httpEndpoint string,
processType string,
invocationTimeout int64,
) (Application, Warnings, error) {
app, getWarnings, err := actor.GetApplicationByNameAndSpace(appN... | [
"func",
"(",
"actor",
"Actor",
")",
"SetApplicationProcessHealthCheckTypeByNameAndSpace",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
",",
"healthCheckType",
"constant",
".",
"HealthCheckType",
",",
"httpEndpoint",
"string",
",",
"processType",
"string",
",",
... | // SetApplicationProcessHealthCheckTypeByNameAndSpace sets the health check
// information of the provided processType for an application with the given
// name and space GUID. | [
"SetApplicationProcessHealthCheckTypeByNameAndSpace",
"sets",
"the",
"health",
"check",
"information",
"of",
"the",
"provided",
"processType",
"for",
"an",
"application",
"with",
"the",
"given",
"name",
"and",
"space",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L131-L154 |
26,037 | cloudfoundry/cli | actor/v7action/application.go | StopApplication | func (actor Actor) StopApplication(appGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.UpdateApplicationStop(appGUID)
return Warnings(warnings), err
} | go | func (actor Actor) StopApplication(appGUID string) (Warnings, error) {
_, warnings, err := actor.CloudControllerClient.UpdateApplicationStop(appGUID)
return Warnings(warnings), err
} | [
"func",
"(",
"actor",
"Actor",
")",
"StopApplication",
"(",
"appGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"_",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"UpdateApplicationStop",
"(",
"appGUID",
")",
... | // StopApplication stops an application. | [
"StopApplication",
"stops",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L157-L161 |
26,038 | cloudfoundry/cli | actor/v7action/application.go | StartApplication | func (actor Actor) StartApplication(appGUID string) (Application, Warnings, error) {
updatedApp, warnings, err := actor.CloudControllerClient.UpdateApplicationStart(appGUID)
if err != nil {
return Application{}, Warnings(warnings), err
}
return actor.convertCCToActorApplication(updatedApp), Warnings(warnings), n... | go | func (actor Actor) StartApplication(appGUID string) (Application, Warnings, error) {
updatedApp, warnings, err := actor.CloudControllerClient.UpdateApplicationStart(appGUID)
if err != nil {
return Application{}, Warnings(warnings), err
}
return actor.convertCCToActorApplication(updatedApp), Warnings(warnings), n... | [
"func",
"(",
"actor",
"Actor",
")",
"StartApplication",
"(",
"appGUID",
"string",
")",
"(",
"Application",
",",
"Warnings",
",",
"error",
")",
"{",
"updatedApp",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"UpdateApplicationS... | // StartApplication starts an application. | [
"StartApplication",
"starts",
"an",
"application",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L164-L171 |
26,039 | cloudfoundry/cli | actor/v7action/application.go | RestartApplication | func (actor Actor) RestartApplication(appGUID string) (Warnings, error) {
var allWarnings Warnings
_, warnings, err := actor.CloudControllerClient.UpdateApplicationRestart(appGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return allWarnings, err
}
pollingWarnings, err := actor.PollStart(a... | go | func (actor Actor) RestartApplication(appGUID string) (Warnings, error) {
var allWarnings Warnings
_, warnings, err := actor.CloudControllerClient.UpdateApplicationRestart(appGUID)
allWarnings = append(allWarnings, warnings...)
if err != nil {
return allWarnings, err
}
pollingWarnings, err := actor.PollStart(a... | [
"func",
"(",
"actor",
"Actor",
")",
"RestartApplication",
"(",
"appGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"var",
"allWarnings",
"Warnings",
"\n",
"_",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudControllerClient",
".",
"U... | // RestartApplication restarts an application and waits for it to start. | [
"RestartApplication",
"restarts",
"an",
"application",
"and",
"waits",
"for",
"it",
"to",
"start",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/application.go#L174-L185 |
26,040 | cloudfoundry/cli | actor/actionerror/domain_not_found_error.go | Error | func (e DomainNotFoundError) Error() string {
switch {
case e.Name != "":
return fmt.Sprintf("Domain %s not found", e.Name)
case e.GUID != "":
return fmt.Sprintf("Domain with GUID %s not found", e.GUID)
default:
return "Domain not found"
}
} | go | func (e DomainNotFoundError) Error() string {
switch {
case e.Name != "":
return fmt.Sprintf("Domain %s not found", e.Name)
case e.GUID != "":
return fmt.Sprintf("Domain with GUID %s not found", e.GUID)
default:
return "Domain not found"
}
} | [
"func",
"(",
"e",
"DomainNotFoundError",
")",
"Error",
"(",
")",
"string",
"{",
"switch",
"{",
"case",
"e",
".",
"Name",
"!=",
"\"",
"\"",
":",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"Name",
")",
"\n",
"case",
"e",
".",
... | // Error method to display the error message. | [
"Error",
"method",
"to",
"display",
"the",
"error",
"message",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/actionerror/domain_not_found_error.go#L13-L22 |
26,041 | cloudfoundry/cli | integration/helpers/app.go | WithProcfileApp | func WithProcfileApp(f func(dir string)) {
dir, err := ioutil.TempDir("", "simple-ruby-app")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(dir)
err = ioutil.WriteFile(filepath.Join(dir, "Procfile"), []byte(`---
web: ruby -run -e httpd . -p $PORT
console: bundle exec irb`,
), 0666)
Expect(err).ToNot(HaveOc... | go | func WithProcfileApp(f func(dir string)) {
dir, err := ioutil.TempDir("", "simple-ruby-app")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(dir)
err = ioutil.WriteFile(filepath.Join(dir, "Procfile"), []byte(`---
web: ruby -run -e httpd . -p $PORT
console: bundle exec irb`,
), 0666)
Expect(err).ToNot(HaveOc... | [
"func",
"WithProcfileApp",
"(",
"f",
"func",
"(",
"dir",
"string",
")",
")",
"{",
"dir",
",",
"err",
":=",
"ioutil",
".",
"TempDir",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"Expect",
"(",
"err",
")",
".",
"ToNot",
"(",
"HaveOccurred",
"(",
"... | // WithProcfileApp creates an application to use with your CLI command
// that contains Procfile defining web and worker processes. | [
"WithProcfileApp",
"creates",
"an",
"application",
"to",
"use",
"with",
"your",
"CLI",
"command",
"that",
"contains",
"Procfile",
"defining",
"web",
"and",
"worker",
"processes",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L88-L117 |
26,042 | cloudfoundry/cli | integration/helpers/app.go | AppGUID | func AppGUID(appName string) string {
session := CF("app", appName, "--guid")
Eventually(session).Should(Exit(0))
return strings.TrimSpace(string(session.Out.Contents()))
} | go | func AppGUID(appName string) string {
session := CF("app", appName, "--guid")
Eventually(session).Should(Exit(0))
return strings.TrimSpace(string(session.Out.Contents()))
} | [
"func",
"AppGUID",
"(",
"appName",
"string",
")",
"string",
"{",
"session",
":=",
"CF",
"(",
"\"",
"\"",
",",
"appName",
",",
"\"",
"\"",
")",
"\n",
"Eventually",
"(",
"session",
")",
".",
"Should",
"(",
"Exit",
"(",
"0",
")",
")",
"\n",
"return",
... | // AppGUID returns the GUID for an app in the currently targeted space. | [
"AppGUID",
"returns",
"the",
"GUID",
"for",
"an",
"app",
"in",
"the",
"currently",
"targeted",
"space",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L171-L175 |
26,043 | cloudfoundry/cli | integration/helpers/app.go | WriteManifest | func WriteManifest(path string, manifest map[string]interface{}) {
body, err := yaml.Marshal(manifest)
Expect(err).ToNot(HaveOccurred())
err = ioutil.WriteFile(path, body, 0666)
Expect(err).ToNot(HaveOccurred())
} | go | func WriteManifest(path string, manifest map[string]interface{}) {
body, err := yaml.Marshal(manifest)
Expect(err).ToNot(HaveOccurred())
err = ioutil.WriteFile(path, body, 0666)
Expect(err).ToNot(HaveOccurred())
} | [
"func",
"WriteManifest",
"(",
"path",
"string",
",",
"manifest",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"{",
"body",
",",
"err",
":=",
"yaml",
".",
"Marshal",
"(",
"manifest",
")",
"\n",
"Expect",
"(",
"err",
")",
".",
"ToNot",
"(",
... | // WriteManifest will write out a YAML manifest file at the specified path. | [
"WriteManifest",
"will",
"write",
"out",
"a",
"YAML",
"manifest",
"file",
"at",
"the",
"specified",
"path",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L185-L190 |
26,044 | cloudfoundry/cli | integration/helpers/app.go | Zipit | func Zipit(source, target, prefix string) error {
// Thanks to Svett Ralchev
// http://blog.ralch.com/tutorial/golang-working-with-zip/
zipfile, err := os.Create(target)
if err != nil {
return err
}
defer zipfile.Close()
if prefix != "" {
_, err = io.WriteString(zipfile, prefix)
if err != nil {
return... | go | func Zipit(source, target, prefix string) error {
// Thanks to Svett Ralchev
// http://blog.ralch.com/tutorial/golang-working-with-zip/
zipfile, err := os.Create(target)
if err != nil {
return err
}
defer zipfile.Close()
if prefix != "" {
_, err = io.WriteString(zipfile, prefix)
if err != nil {
return... | [
"func",
"Zipit",
"(",
"source",
",",
"target",
",",
"prefix",
"string",
")",
"error",
"{",
"// Thanks to Svett Ralchev",
"// http://blog.ralch.com/tutorial/golang-working-with-zip/",
"zipfile",
",",
"err",
":=",
"os",
".",
"Create",
"(",
"target",
")",
"\n",
"if",
... | // Zipit zips the source into a .zip file in the target dir | [
"Zipit",
"zips",
"the",
"source",
"into",
"a",
".",
"zip",
"file",
"in",
"the",
"target",
"dir"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/app.go#L193-L261 |
26,045 | cloudfoundry/cli | api/cloudcontroller/ccv2/filter.go | ConvertFilterParameters | func ConvertFilterParameters(filters []Filter) url.Values {
params := url.Values{"q": []string{}}
for _, filter := range filters {
params["q"] = append(params["q"], filter.format())
}
return params
} | go | func ConvertFilterParameters(filters []Filter) url.Values {
params := url.Values{"q": []string{}}
for _, filter := range filters {
params["q"] = append(params["q"], filter.format())
}
return params
} | [
"func",
"ConvertFilterParameters",
"(",
"filters",
"[",
"]",
"Filter",
")",
"url",
".",
"Values",
"{",
"params",
":=",
"url",
".",
"Values",
"{",
"\"",
"\"",
":",
"[",
"]",
"string",
"{",
"}",
"}",
"\n",
"for",
"_",
",",
"filter",
":=",
"range",
"f... | // ConvertFilterParameters converts a Filter object into a collection that
// cloudcontroller.Request can accept. | [
"ConvertFilterParameters",
"converts",
"a",
"Filter",
"object",
"into",
"a",
"collection",
"that",
"cloudcontroller",
".",
"Request",
"can",
"accept",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/filter.go#L30-L37 |
26,046 | cloudfoundry/cli | actor/pluginaction/plugin_info.go | GetPluginInfoFromRepositoriesForPlatform | func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error) {
var reposWithPlugin []string
var newestPluginInfo PluginInfo
var pluginFoundWithIncompatibleBinary bool
for _, repo := range pluginRepos {
plugi... | go | func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error) {
var reposWithPlugin []string
var newestPluginInfo PluginInfo
var pluginFoundWithIncompatibleBinary bool
for _, repo := range pluginRepos {
plugi... | [
"func",
"(",
"actor",
"Actor",
")",
"GetPluginInfoFromRepositoriesForPlatform",
"(",
"pluginName",
"string",
",",
"pluginRepos",
"[",
"]",
"configv3",
".",
"PluginRepository",
",",
"platform",
"string",
")",
"(",
"PluginInfo",
",",
"[",
"]",
"string",
",",
"erro... | // GetPluginInfoFromRepositoriesForPlatform returns the newest version of the specified plugin
// and all the repositories that contain that version. | [
"GetPluginInfoFromRepositoriesForPlatform",
"returns",
"the",
"newest",
"version",
"of",
"the",
"specified",
"plugin",
"and",
"all",
"the",
"repositories",
"that",
"contain",
"that",
"version",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/plugin_info.go#L20-L55 |
26,047 | cloudfoundry/cli | actor/pluginaction/plugin_info.go | GetPlatformString | func (actor Actor) GetPlatformString(runtimeGOOS string, runtimeGOARCH string) string {
return generic.GeneratePlatform(runtime.GOOS, runtime.GOARCH)
} | go | func (actor Actor) GetPlatformString(runtimeGOOS string, runtimeGOARCH string) string {
return generic.GeneratePlatform(runtime.GOOS, runtime.GOARCH)
} | [
"func",
"(",
"actor",
"Actor",
")",
"GetPlatformString",
"(",
"runtimeGOOS",
"string",
",",
"runtimeGOARCH",
"string",
")",
"string",
"{",
"return",
"generic",
".",
"GeneratePlatform",
"(",
"runtime",
".",
"GOOS",
",",
"runtime",
".",
"GOARCH",
")",
"\n",
"}... | // GetPlatformString exists solely for the purposes of mocking it out for command-layers tests. | [
"GetPlatformString",
"exists",
"solely",
"for",
"the",
"purposes",
"of",
"mocking",
"it",
"out",
"for",
"command",
"-",
"layers",
"tests",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/plugin_info.go#L58-L60 |
26,048 | cloudfoundry/cli | actor/pluginaction/plugin_info.go | getPluginInfoFromRepositoryForPlatform | func (actor Actor) getPluginInfoFromRepositoryForPlatform(pluginName string, pluginRepo configv3.PluginRepository, platform string) (PluginInfo, error) {
pluginRepository, err := actor.client.GetPluginRepository(pluginRepo.URL)
if err != nil {
return PluginInfo{}, err
}
var pluginFoundWithIncompatibleBinary bool... | go | func (actor Actor) getPluginInfoFromRepositoryForPlatform(pluginName string, pluginRepo configv3.PluginRepository, platform string) (PluginInfo, error) {
pluginRepository, err := actor.client.GetPluginRepository(pluginRepo.URL)
if err != nil {
return PluginInfo{}, err
}
var pluginFoundWithIncompatibleBinary bool... | [
"func",
"(",
"actor",
"Actor",
")",
"getPluginInfoFromRepositoryForPlatform",
"(",
"pluginName",
"string",
",",
"pluginRepo",
"configv3",
".",
"PluginRepository",
",",
"platform",
"string",
")",
"(",
"PluginInfo",
",",
"error",
")",
"{",
"pluginRepository",
",",
"... | // getPluginInfoFromRepositoryForPlatform returns the plugin info, if found, from
// the specified repository for the specified platform. | [
"getPluginInfoFromRepositoryForPlatform",
"returns",
"the",
"plugin",
"info",
"if",
"found",
"from",
"the",
"specified",
"repository",
"for",
"the",
"specified",
"platform",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/plugin_info.go#L64-L96 |
26,049 | cloudfoundry/cli | util/generic/executable_filename_windows.go | ExecutableFilename | func ExecutableFilename(name string) string {
if strings.HasSuffix(name, ".exe") {
return name
}
return fmt.Sprintf("%s.exe", name)
} | go | func ExecutableFilename(name string) string {
if strings.HasSuffix(name, ".exe") {
return name
}
return fmt.Sprintf("%s.exe", name)
} | [
"func",
"ExecutableFilename",
"(",
"name",
"string",
")",
"string",
"{",
"if",
"strings",
".",
"HasSuffix",
"(",
"name",
",",
"\"",
"\"",
")",
"{",
"return",
"name",
"\n",
"}",
"\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"name",
")",... | // ExecutableFilename appends '.exe' to a filename when necessary in order to
// make it executable on Windows | [
"ExecutableFilename",
"appends",
".",
"exe",
"to",
"a",
"filename",
"when",
"necessary",
"in",
"order",
"to",
"make",
"it",
"executable",
"on",
"Windows"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/generic/executable_filename_windows.go#L12-L17 |
26,050 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship_list.go | EntitleIsolationSegmentToOrganizations | func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: organizationGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPReq... | go | func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: organizationGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPReq... | [
"func",
"(",
"client",
"*",
"Client",
")",
"EntitleIsolationSegmentToOrganizations",
"(",
"isolationSegmentGUID",
"string",
",",
"organizationGUIDs",
"[",
"]",
"string",
")",
"(",
"RelationshipList",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
"... | // EntitleIsolationSegmentToOrganizations will create a link between the
// isolation segment and the list of organizations provided. | [
"EntitleIsolationSegmentToOrganizations",
"will",
"create",
"a",
"link",
"between",
"the",
"isolation",
"segment",
"and",
"the",
"list",
"of",
"organizations",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship_list.go#L50-L72 |
26,051 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship_list.go | ShareServiceInstanceToSpaces | func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: spaceGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
Re... | go | func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (RelationshipList, Warnings, error) {
body, err := json.Marshal(RelationshipList{GUIDs: spaceGUIDs})
if err != nil {
return RelationshipList{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
Re... | [
"func",
"(",
"client",
"*",
"Client",
")",
"ShareServiceInstanceToSpaces",
"(",
"serviceInstanceGUID",
"string",
",",
"spaceGUIDs",
"[",
"]",
"string",
")",
"(",
"RelationshipList",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
"... | // ShareServiceInstanceToSpaces will create a sharing relationship between
// the service instance and the shared-to space for each space provided. | [
"ShareServiceInstanceToSpaces",
"will",
"create",
"a",
"sharing",
"relationship",
"between",
"the",
"service",
"instance",
"and",
"the",
"shared",
"-",
"to",
"space",
"for",
"each",
"space",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship_list.go#L76-L99 |
26,052 | cloudfoundry/cli | util/panichandler/handler.go | HandlePanic | func HandlePanic() {
stackTraceBytes := make([]byte, maxStackSizeLimit)
runtime.Stack(stackTraceBytes, true)
stackTrace := "\t" + strings.Replace(string(stackTraceBytes), "\n", "\n\t", -1)
if err := recover(); err != nil {
formattedString := `
Something unexpected happened. This is a bug in {{.Binary}}.
Plea... | go | func HandlePanic() {
stackTraceBytes := make([]byte, maxStackSizeLimit)
runtime.Stack(stackTraceBytes, true)
stackTrace := "\t" + strings.Replace(string(stackTraceBytes), "\n", "\n\t", -1)
if err := recover(); err != nil {
formattedString := `
Something unexpected happened. This is a bug in {{.Binary}}.
Plea... | [
"func",
"HandlePanic",
"(",
")",
"{",
"stackTraceBytes",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"maxStackSizeLimit",
")",
"\n",
"runtime",
".",
"Stack",
"(",
"stackTraceBytes",
",",
"true",
")",
"\n",
"stackTrace",
":=",
"\"",
"\\t",
"\"",
"+",
"strin... | // HandlePanic will recover from any panics and display a friendly error
// message with additional information used for debugging the panic. | [
"HandlePanic",
"will",
"recover",
"from",
"any",
"panics",
"and",
"display",
"a",
"friendly",
"error",
"message",
"with",
"additional",
"information",
"used",
"for",
"debugging",
"the",
"panic",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/panichandler/handler.go#L17-L77 |
26,053 | cloudfoundry/cli | api/cloudcontroller/ccv2/domain.go | UnmarshalJSON | func (domain *Domain) UnmarshalJSON(data []byte) error {
var ccDomain struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
RouterGroupGUID string `json:"router_group_guid"`
RouterGroupType string `json:"router_group_type"`
Internal bool `... | go | func (domain *Domain) UnmarshalJSON(data []byte) error {
var ccDomain struct {
Metadata internal.Metadata `json:"metadata"`
Entity struct {
Name string `json:"name"`
RouterGroupGUID string `json:"router_group_guid"`
RouterGroupType string `json:"router_group_type"`
Internal bool `... | [
"func",
"(",
"domain",
"*",
"Domain",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccDomain",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"`json:\"metadata\"`",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",
... | // UnmarshalJSON helps unmarshal a Cloud Controller Domain response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Domain",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/domain.go#L38-L59 |
26,054 | cloudfoundry/cli | api/cloudcontroller/ccv2/domain.go | GetPrivateDomain | func (client *Client) GetPrivateDomain(domainGUID string) (Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainRequest,
URIParams: map[string]string{"private_domain_guid": domainGUID},
})
if err != nil {
return Domain{}, nil, err
}
var dom... | go | func (client *Client) GetPrivateDomain(domainGUID string) (Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainRequest,
URIParams: map[string]string{"private_domain_guid": domainGUID},
})
if err != nil {
return Domain{}, nil, err
}
var dom... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetPrivateDomain",
"(",
"domainGUID",
"string",
")",
"(",
"Domain",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
... | // GetPrivateDomain returns the Private Domain associated with the provided
// Domain GUID. | [
"GetPrivateDomain",
"returns",
"the",
"Private",
"Domain",
"associated",
"with",
"the",
"provided",
"Domain",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/domain.go#L119-L140 |
26,055 | cloudfoundry/cli | api/cloudcontroller/ccv2/domain.go | GetPrivateDomains | func (client *Client) GetPrivateDomains(filters ...Filter) ([]Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return []Domain{}, nil, err
}
fullDomainsList := []... | go | func (client *Client) GetPrivateDomains(filters ...Filter) ([]Domain, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetPrivateDomainsRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return []Domain{}, nil, err
}
fullDomainsList := []... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetPrivateDomains",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Domain",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"... | // GetPrivateDomains returns the private domains this client has access to. | [
"GetPrivateDomains",
"returns",
"the",
"private",
"domains",
"this",
"client",
"has",
"access",
"to",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/domain.go#L143-L167 |
26,056 | cloudfoundry/cli | command/common/command_list_v6.go | HasCommand | func (c commandList) HasCommand(name string) bool {
if name == "" {
return false
}
cType := reflect.TypeOf(c)
_, found := cType.FieldByNameFunc(
func(fieldName string) bool {
field, _ := cType.FieldByName(fieldName)
return field.Tag.Get("command") == name
},
)
return found
} | go | func (c commandList) HasCommand(name string) bool {
if name == "" {
return false
}
cType := reflect.TypeOf(c)
_, found := cType.FieldByNameFunc(
func(fieldName string) bool {
field, _ := cType.FieldByName(fieldName)
return field.Tag.Get("command") == name
},
)
return found
} | [
"func",
"(",
"c",
"commandList",
")",
"HasCommand",
"(",
"name",
"string",
")",
"bool",
"{",
"if",
"name",
"==",
"\"",
"\"",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"cType",
":=",
"reflect",
".",
"TypeOf",
"(",
"c",
")",
"\n",
"_",
",",
"found",... | // HasCommand returns true if the command name is in the command list. | [
"HasCommand",
"returns",
"true",
"if",
"the",
"command",
"name",
"is",
"in",
"the",
"command",
"list",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/common/command_list_v6.go#L218-L232 |
26,057 | cloudfoundry/cli | util/ui/log_message.go | DisplayLogMessage | func (ui *UI) DisplayLogMessage(message LogMessage, displayHeader bool) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
var header string
if displayHeader {
time := message.Timestamp().In(ui.TimezoneLocation).Format(LogTimestampFormat)
header = fmt.Sprintf("%s [%s/%s] %s ",
time,
message.SourceT... | go | func (ui *UI) DisplayLogMessage(message LogMessage, displayHeader bool) {
ui.terminalLock.Lock()
defer ui.terminalLock.Unlock()
var header string
if displayHeader {
time := message.Timestamp().In(ui.TimezoneLocation).Format(LogTimestampFormat)
header = fmt.Sprintf("%s [%s/%s] %s ",
time,
message.SourceT... | [
"func",
"(",
"ui",
"*",
"UI",
")",
"DisplayLogMessage",
"(",
"message",
"LogMessage",
",",
"displayHeader",
"bool",
")",
"{",
"ui",
".",
"terminalLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"ui",
".",
"terminalLock",
".",
"Unlock",
"(",
")",
"\n\n",
"... | // DisplayLogMessage formats and outputs a given log message. | [
"DisplayLogMessage",
"formats",
"and",
"outputs",
"a",
"given",
"log",
"message",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/ui/log_message.go#L27-L50 |
26,058 | cloudfoundry/cli | command/common/install_plugin_command.go | handleFetchingPluginInfoFromRepositoriesError | func (InstallPluginCommand) handleFetchingPluginInfoFromRepositoriesError(fetchErr actionerror.FetchingPluginInfoFromRepositoryError) error {
switch clientErr := fetchErr.Err.(type) {
case pluginerror.RawHTTPStatusError:
return translatableerror.FetchingPluginInfoFromRepositoriesError{
Message: clientErr.... | go | func (InstallPluginCommand) handleFetchingPluginInfoFromRepositoriesError(fetchErr actionerror.FetchingPluginInfoFromRepositoryError) error {
switch clientErr := fetchErr.Err.(type) {
case pluginerror.RawHTTPStatusError:
return translatableerror.FetchingPluginInfoFromRepositoriesError{
Message: clientErr.... | [
"func",
"(",
"InstallPluginCommand",
")",
"handleFetchingPluginInfoFromRepositoriesError",
"(",
"fetchErr",
"actionerror",
".",
"FetchingPluginInfoFromRepositoryError",
")",
"error",
"{",
"switch",
"clientErr",
":=",
"fetchErr",
".",
"Err",
".",
"(",
"type",
")",
"{",
... | // These are specific errors that we output to the user in the context of
// installing from any repository. | [
"These",
"are",
"specific",
"errors",
"that",
"we",
"output",
"to",
"the",
"user",
"in",
"the",
"context",
"of",
"installing",
"from",
"any",
"repository",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/common/install_plugin_command.go#L246-L269 |
26,059 | cloudfoundry/cli | api/cloudcontroller/ccv3/environment.go | GetApplicationEnvironment | func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
URIParams: internal.Params{"app_guid": appGUID},
RequestName: internal.GetApplicationEnvRequest,
})
if err != nil {
return Environment{}, nil, err
}
var re... | go | func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
URIParams: internal.Params{"app_guid": appGUID},
RequestName: internal.GetApplicationEnvRequest,
})
if err != nil {
return Environment{}, nil, err
}
var re... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetApplicationEnvironment",
"(",
"appGUID",
"string",
")",
"(",
"Environment",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"URI... | // GetApplicationEnvironment fetches all the environment variables on
// an application by groups. | [
"GetApplicationEnvironment",
"fetches",
"all",
"the",
"environment",
"variables",
"on",
"an",
"application",
"by",
"groups",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/environment.go#L30-L45 |
26,060 | cloudfoundry/cli | command/v6/shared/new_clients.go | NewClients | func NewClients(config command.Config, ui command.UI, targetCF bool) (*ccv2.Client, *uaa.Client, error) {
ccWrappers := []ccv2.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
ccWrappers = append(ccWrappers, ccWrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay()))
}
if location != n... | go | func NewClients(config command.Config, ui command.UI, targetCF bool) (*ccv2.Client, *uaa.Client, error) {
ccWrappers := []ccv2.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
ccWrappers = append(ccWrappers, ccWrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay()))
}
if location != n... | [
"func",
"NewClients",
"(",
"config",
"command",
".",
"Config",
",",
"ui",
"command",
".",
"UI",
",",
"targetCF",
"bool",
")",
"(",
"*",
"ccv2",
".",
"Client",
",",
"*",
"uaa",
".",
"Client",
",",
"error",
")",
"{",
"ccWrappers",
":=",
"[",
"]",
"cc... | // NewClients creates a new V2 Cloud Controller client and UAA client using the
// passed in config. | [
"NewClients",
"creates",
"a",
"new",
"V2",
"Cloud",
"Controller",
"client",
"and",
"UAA",
"client",
"using",
"the",
"passed",
"in",
"config",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/shared/new_clients.go#L16-L90 |
26,061 | cloudfoundry/cli | actor/sharedaction/check_target.go | CheckTarget | func (actor Actor) CheckTarget(targetedOrganizationRequired bool, targetedSpaceRequired bool) error {
if !actor.IsLoggedIn() {
return actionerror.NotLoggedInError{
BinaryName: actor.Config.BinaryName(),
}
}
if targetedOrganizationRequired {
if !actor.IsOrgTargeted() {
return actionerror.NoOrganizationTa... | go | func (actor Actor) CheckTarget(targetedOrganizationRequired bool, targetedSpaceRequired bool) error {
if !actor.IsLoggedIn() {
return actionerror.NotLoggedInError{
BinaryName: actor.Config.BinaryName(),
}
}
if targetedOrganizationRequired {
if !actor.IsOrgTargeted() {
return actionerror.NoOrganizationTa... | [
"func",
"(",
"actor",
"Actor",
")",
"CheckTarget",
"(",
"targetedOrganizationRequired",
"bool",
",",
"targetedSpaceRequired",
"bool",
")",
"error",
"{",
"if",
"!",
"actor",
".",
"IsLoggedIn",
"(",
")",
"{",
"return",
"actionerror",
".",
"NotLoggedInError",
"{",
... | // CheckTarget confirms that the user is logged in. Optionally it will also
// check if an organization and space are targeted. | [
"CheckTarget",
"confirms",
"that",
"the",
"user",
"is",
"logged",
"in",
".",
"Optionally",
"it",
"will",
"also",
"check",
"if",
"an",
"organization",
"and",
"space",
"are",
"targeted",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/sharedaction/check_target.go#L7-L31 |
26,062 | cloudfoundry/cli | api/cloudcontroller/ccv3/task.go | CreateApplicationTask | func (client *Client) CreateApplicationTask(appGUID string, task Task) (Task, Warnings, error) {
bodyBytes, err := json.Marshal(task)
if err != nil {
return Task{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationTasksRequest,
URIParams: internal.Params{
... | go | func (client *Client) CreateApplicationTask(appGUID string, task Task) (Task, Warnings, error) {
bodyBytes, err := json.Marshal(task)
if err != nil {
return Task{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostApplicationTasksRequest,
URIParams: internal.Params{
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateApplicationTask",
"(",
"appGUID",
"string",
",",
"task",
"Task",
")",
"(",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"bodyBytes",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"task",
")",
"\n",... | // CreateApplicationTask runs a command in the Application environment
// associated with the provided Application GUID. | [
"CreateApplicationTask",
"runs",
"a",
"command",
"in",
"the",
"Application",
"environment",
"associated",
"with",
"the",
"provided",
"Application",
"GUID",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/task.go#L37-L61 |
26,063 | cloudfoundry/cli | api/cloudcontroller/ccv3/task.go | GetApplicationTasks | func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationTasksRequest,
URIParams: internal.Params{
"app_guid": appGUID,
},
Query: query,
})
if err != nil {
return nil, n... | go | func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetApplicationTasksRequest,
URIParams: internal.Params{
"app_guid": appGUID,
},
Query: query,
})
if err != nil {
return nil, n... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetApplicationTasks",
"(",
"appGUID",
"string",
",",
"query",
"...",
"Query",
")",
"(",
"[",
"]",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
... | // GetApplicationTasks returns a list of tasks associated with the provided
// application GUID. Results can be filtered by providing URL queries. | [
"GetApplicationTasks",
"returns",
"a",
"list",
"of",
"tasks",
"associated",
"with",
"the",
"provided",
"application",
"GUID",
".",
"Results",
"can",
"be",
"filtered",
"by",
"providing",
"URL",
"queries",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/task.go#L65-L91 |
26,064 | cloudfoundry/cli | api/cloudcontroller/ccv3/task.go | UpdateTaskCancel | func (client *Client) UpdateTaskCancel(taskGUID string) (Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutTaskCancelRequest,
URIParams: internal.Params{
"task_guid": taskGUID,
},
})
if err != nil {
return Task{}, nil, err
}
var task Task
response ... | go | func (client *Client) UpdateTaskCancel(taskGUID string) (Task, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PutTaskCancelRequest,
URIParams: internal.Params{
"task_guid": taskGUID,
},
})
if err != nil {
return Task{}, nil, err
}
var task Task
response ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UpdateTaskCancel",
"(",
"taskGUID",
"string",
")",
"(",
"Task",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{",
"RequestName",
":... | // UpdateTaskCancel cancels a task. | [
"UpdateTaskCancel",
"cancels",
"a",
"task",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/task.go#L94-L116 |
26,065 | cloudfoundry/cli | actor/v7action/feature_flag.go | GetFeatureFlagByName | func (actor Actor) GetFeatureFlagByName(featureFlagName string) (FeatureFlag, Warnings, error) {
var (
ccv3FeatureFlag ccv3.FeatureFlag
warnings ccv3.Warnings
err error
)
ccv3FeatureFlag, warnings, err = actor.CloudControllerClient.GetFeatureFlag(featureFlagName)
if err != nil {
if _, ok... | go | func (actor Actor) GetFeatureFlagByName(featureFlagName string) (FeatureFlag, Warnings, error) {
var (
ccv3FeatureFlag ccv3.FeatureFlag
warnings ccv3.Warnings
err error
)
ccv3FeatureFlag, warnings, err = actor.CloudControllerClient.GetFeatureFlag(featureFlagName)
if err != nil {
if _, ok... | [
"func",
"(",
"actor",
"Actor",
")",
"GetFeatureFlagByName",
"(",
"featureFlagName",
"string",
")",
"(",
"FeatureFlag",
",",
"Warnings",
",",
"error",
")",
"{",
"var",
"(",
"ccv3FeatureFlag",
"ccv3",
".",
"FeatureFlag",
"\n",
"warnings",
"ccv3",
".",
"Warnings"... | // GetFeatureFlagByName returns a featureFlag with the provided name. | [
"GetFeatureFlagByName",
"returns",
"a",
"featureFlag",
"with",
"the",
"provided",
"name",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v7action/feature_flag.go#L12-L28 |
26,066 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | UnmarshalJSON | func (serviceInstance *ServiceInstance) UnmarshalJSON(data []byte) error {
var ccServiceInstance struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
SpaceGUID string `json:"space_guid"`
ServiceGUID string `json:"service_guid"`
Servic... | go | func (serviceInstance *ServiceInstance) UnmarshalJSON(data []byte) error {
var ccServiceInstance struct {
Metadata internal.Metadata
Entity struct {
Name string `json:"name"`
SpaceGUID string `json:"space_guid"`
ServiceGUID string `json:"service_guid"`
Servic... | [
"func",
"(",
"serviceInstance",
"*",
"ServiceInstance",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"ccServiceInstance",
"struct",
"{",
"Metadata",
"internal",
".",
"Metadata",
"\n",
"Entity",
"struct",
"{",
"Name",
"string",... | // UnmarshalJSON helps unmarshal a Cloud Controller Service Instance response. | [
"UnmarshalJSON",
"helps",
"unmarshal",
"a",
"Cloud",
"Controller",
"Service",
"Instance",
"response",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L59-L90 |
26,067 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | CreateServiceInstance | func (client *Client) CreateServiceInstance(spaceGUID, servicePlanGUID, serviceInstance string, parameters map[string]interface{}, tags []string) (ServiceInstance, Warnings, error) {
requestBody := createServiceInstanceRequestBody{
Name: serviceInstance,
ServicePlanGUID: servicePlanGUID,
SpaceGUID: ... | go | func (client *Client) CreateServiceInstance(spaceGUID, servicePlanGUID, serviceInstance string, parameters map[string]interface{}, tags []string) (ServiceInstance, Warnings, error) {
requestBody := createServiceInstanceRequestBody{
Name: serviceInstance,
ServicePlanGUID: servicePlanGUID,
SpaceGUID: ... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateServiceInstance",
"(",
"spaceGUID",
",",
"servicePlanGUID",
",",
"serviceInstance",
"string",
",",
"parameters",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"tags",
"[",
"]",
"string",
")",
"(",
... | // CreateServiceInstance posts a service instance resource with the provided
// attributes to the api and returns the result. | [
"CreateServiceInstance",
"posts",
"a",
"service",
"instance",
"resource",
"with",
"the",
"provided",
"attributes",
"to",
"the",
"api",
"and",
"returns",
"the",
"result",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L108-L138 |
26,068 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | GetServiceInstance | func (client *Client) GetServiceInstance(serviceInstanceGUID string) (ServiceInstance, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err != nil {
return ServiceIn... | go | func (client *Client) GetServiceInstance(serviceInstanceGUID string) (ServiceInstance, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetServiceInstanceRequest,
URIParams: Params{"service_instance_guid": serviceInstanceGUID},
})
if err != nil {
return ServiceIn... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetServiceInstance",
"(",
"serviceInstanceGUID",
"string",
")",
"(",
"ServiceInstance",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{... | // GetServiceInstance returns the service instance with the given GUID. This
// service can be either a managed or user provided. | [
"GetServiceInstance",
"returns",
"the",
"service",
"instance",
"with",
"the",
"given",
"GUID",
".",
"This",
"service",
"can",
"be",
"either",
"a",
"managed",
"or",
"user",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L142-L158 |
26,069 | cloudfoundry/cli | api/cloudcontroller/ccv2/service_instance.go | GetSpaceServiceInstances | func (client *Client) GetSpaceServiceInstances(spaceGUID string, includeUserProvidedServices bool, filters ...Filter) ([]ServiceInstance, Warnings, error) {
query := ConvertFilterParameters(filters)
if includeUserProvidedServices {
query.Add("return_user_provided_service_instances", "true")
}
request, err := cl... | go | func (client *Client) GetSpaceServiceInstances(spaceGUID string, includeUserProvidedServices bool, filters ...Filter) ([]ServiceInstance, Warnings, error) {
query := ConvertFilterParameters(filters)
if includeUserProvidedServices {
query.Add("return_user_provided_service_instances", "true")
}
request, err := cl... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetSpaceServiceInstances",
"(",
"spaceGUID",
"string",
",",
"includeUserProvidedServices",
"bool",
",",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"ServiceInstance",
",",
"Warnings",
",",
"error",
")",
"{",
"que... | // GetSpaceServiceInstances returns back a list of Service Instances based off
// of the space and filters provided. User provided services will be included
// if includeUserProvidedServices is set to true. | [
"GetSpaceServiceInstances",
"returns",
"back",
"a",
"list",
"of",
"Service",
"Instances",
"based",
"off",
"of",
"the",
"space",
"and",
"filters",
"provided",
".",
"User",
"provided",
"services",
"will",
"be",
"included",
"if",
"includeUserProvidedServices",
"is",
... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_instance.go#L190-L220 |
26,070 | cloudfoundry/cli | actor/v2action/service_instance_summary.go | getAndSetSharedInformation | func (actor Actor) getAndSetSharedInformation(summary *ServiceInstanceSummary, spaceGUID string) (Warnings, error) {
var (
warnings Warnings
err error
)
// Part of determining if a service instance is shareable, we need to find
// out if the service_instance_sharing feature flag is enabled
featureFlags, ... | go | func (actor Actor) getAndSetSharedInformation(summary *ServiceInstanceSummary, spaceGUID string) (Warnings, error) {
var (
warnings Warnings
err error
)
// Part of determining if a service instance is shareable, we need to find
// out if the service_instance_sharing feature flag is enabled
featureFlags, ... | [
"func",
"(",
"actor",
"Actor",
")",
"getAndSetSharedInformation",
"(",
"summary",
"*",
"ServiceInstanceSummary",
",",
"spaceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"var",
"(",
"warnings",
"Warnings",
"\n",
"err",
"error",
"\n",
")",
"\... | // getAndSetSharedInformation gets a service instance's shared from or shared to information, | [
"getAndSetSharedInformation",
"gets",
"a",
"service",
"instance",
"s",
"shared",
"from",
"or",
"shared",
"to",
"information"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_instance_summary.go#L106-L168 |
26,071 | cloudfoundry/cli | actor/v3action/package.go | GetApplicationPackages | func (actor *Actor) GetApplicationPackages(appName string, spaceGUID string) ([]Package, Warnings, error) {
app, allWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if err != nil {
return nil, allWarnings, err
}
ccv3Packages, warnings, err := actor.CloudControllerClient.GetPackages(
ccv3... | go | func (actor *Actor) GetApplicationPackages(appName string, spaceGUID string) ([]Package, Warnings, error) {
app, allWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
if err != nil {
return nil, allWarnings, err
}
ccv3Packages, warnings, err := actor.CloudControllerClient.GetPackages(
ccv3... | [
"func",
"(",
"actor",
"*",
"Actor",
")",
"GetApplicationPackages",
"(",
"appName",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"[",
"]",
"Package",
",",
"Warnings",
",",
"error",
")",
"{",
"app",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
... | // GetApplicationPackages returns a list of package of an app. | [
"GetApplicationPackages",
"returns",
"a",
"list",
"of",
"package",
"of",
"an",
"app",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/package.go#L133-L153 |
26,072 | cloudfoundry/cli | actor/v3action/package.go | PollPackage | func (actor Actor) PollPackage(pkg Package) (Package, Warnings, error) {
var allWarnings Warnings
for pkg.State != constant.PackageReady && pkg.State != constant.PackageFailed && pkg.State != constant.PackageExpired {
time.Sleep(actor.Config.PollingInterval())
ccPkg, warnings, err := actor.CloudControllerClient.... | go | func (actor Actor) PollPackage(pkg Package) (Package, Warnings, error) {
var allWarnings Warnings
for pkg.State != constant.PackageReady && pkg.State != constant.PackageFailed && pkg.State != constant.PackageExpired {
time.Sleep(actor.Config.PollingInterval())
ccPkg, warnings, err := actor.CloudControllerClient.... | [
"func",
"(",
"actor",
"Actor",
")",
"PollPackage",
"(",
"pkg",
"Package",
")",
"(",
"Package",
",",
"Warnings",
",",
"error",
")",
"{",
"var",
"allWarnings",
"Warnings",
"\n\n",
"for",
"pkg",
".",
"State",
"!=",
"constant",
".",
"PackageReady",
"&&",
"pk... | // PollPackage returns a package of an app. | [
"PollPackage",
"returns",
"a",
"package",
"of",
"an",
"app",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/package.go#L183-L209 |
26,073 | cloudfoundry/cli | integration/helpers/login.go | GetCredentials | func GetCredentials() (string, string) {
username := os.Getenv("CF_INT_USERNAME")
if username == "" {
username = "admin"
}
password := os.Getenv("CF_INT_PASSWORD")
if password == "" {
password = "admin"
}
return username, password
} | go | func GetCredentials() (string, string) {
username := os.Getenv("CF_INT_USERNAME")
if username == "" {
username = "admin"
}
password := os.Getenv("CF_INT_PASSWORD")
if password == "" {
password = "admin"
}
return username, password
} | [
"func",
"GetCredentials",
"(",
")",
"(",
"string",
",",
"string",
")",
"{",
"username",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"username",
"==",
"\"",
"\"",
"{",
"username",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"password",
":=",
... | // GetCredentials returns back the username and the password. | [
"GetCredentials",
"returns",
"back",
"the",
"username",
"and",
"the",
"password",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/login.go#L83-L93 |
26,074 | cloudfoundry/cli | integration/helpers/login.go | SkipIfOIDCCredentialsNotSet | func SkipIfOIDCCredentialsNotSet() (string, string) {
oidcUsername := os.Getenv("CF_INT_OIDC_USERNAME")
oidcPassword := os.Getenv("CF_INT_OIDC_PASSWORD")
if oidcUsername == "" || oidcPassword == "" {
Skip("CF_INT_OIDC_USERNAME or CF_INT_OIDC_PASSWORD is not set")
}
return oidcUsername, oidcPassword
} | go | func SkipIfOIDCCredentialsNotSet() (string, string) {
oidcUsername := os.Getenv("CF_INT_OIDC_USERNAME")
oidcPassword := os.Getenv("CF_INT_OIDC_PASSWORD")
if oidcUsername == "" || oidcPassword == "" {
Skip("CF_INT_OIDC_USERNAME or CF_INT_OIDC_PASSWORD is not set")
}
return oidcUsername, oidcPassword
} | [
"func",
"SkipIfOIDCCredentialsNotSet",
"(",
")",
"(",
"string",
",",
"string",
")",
"{",
"oidcUsername",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"oidcPassword",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"oidcUsername",... | // SkipIfOIDCCredentialsNotSet returns back the username and the password for
// OIDC origin, or skips the test if those values are not set. | [
"SkipIfOIDCCredentialsNotSet",
"returns",
"back",
"the",
"username",
"and",
"the",
"password",
"for",
"OIDC",
"origin",
"or",
"skips",
"the",
"test",
"if",
"those",
"values",
"are",
"not",
"set",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/login.go#L97-L106 |
26,075 | cloudfoundry/cli | actor/pushaction/domain.go | DefaultDomain | func (actor Actor) DefaultDomain(orgGUID string) (v2action.Domain, Warnings, error) {
log.Infoln("getting org domains for org GUID:", orgGUID)
// the domains object contains all the shared domains AND all domains private to this org
domains, warnings, err := actor.V2Actor.GetOrganizationDomains(orgGUID)
if err != n... | go | func (actor Actor) DefaultDomain(orgGUID string) (v2action.Domain, Warnings, error) {
log.Infoln("getting org domains for org GUID:", orgGUID)
// the domains object contains all the shared domains AND all domains private to this org
domains, warnings, err := actor.V2Actor.GetOrganizationDomains(orgGUID)
if err != n... | [
"func",
"(",
"actor",
"Actor",
")",
"DefaultDomain",
"(",
"orgGUID",
"string",
")",
"(",
"v2action",
".",
"Domain",
",",
"Warnings",
",",
"error",
")",
"{",
"log",
".",
"Infoln",
"(",
"\"",
"\"",
",",
"orgGUID",
")",
"\n",
"// the domains object contains a... | // DefaultDomain looks up the shared and then private domains and returns back
// the first one in the list as the default. | [
"DefaultDomain",
"looks",
"up",
"the",
"shared",
"and",
"then",
"private",
"domains",
"and",
"returns",
"back",
"the",
"first",
"one",
"in",
"the",
"list",
"as",
"the",
"default",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pushaction/domain.go#L11-L36 |
26,076 | cloudfoundry/cli | integration/helpers/matchers.go | SayPath | func SayPath(format string, path string) types.GomegaMatcher {
theRealDir, err := filepath.EvalSymlinks(filepath.Dir(path))
Expect(err).ToNot(HaveOccurred())
theRealPath := filepath.Join(theRealDir, filepath.Base(path))
if runtime.GOOS == "windows" {
expected := "(?i)" + format
expected = fmt.Sprintf(expected,... | go | func SayPath(format string, path string) types.GomegaMatcher {
theRealDir, err := filepath.EvalSymlinks(filepath.Dir(path))
Expect(err).ToNot(HaveOccurred())
theRealPath := filepath.Join(theRealDir, filepath.Base(path))
if runtime.GOOS == "windows" {
expected := "(?i)" + format
expected = fmt.Sprintf(expected,... | [
"func",
"SayPath",
"(",
"format",
"string",
",",
"path",
"string",
")",
"types",
".",
"GomegaMatcher",
"{",
"theRealDir",
",",
"err",
":=",
"filepath",
".",
"EvalSymlinks",
"(",
"filepath",
".",
"Dir",
"(",
"path",
")",
")",
"\n",
"Expect",
"(",
"err",
... | // SayPath is used to assert that a path is printed. On Windows, it uses a
// case-insensitive match and escapes the path. On non-Windows, it evaluates
// the base directory of the path for symlniks. | [
"SayPath",
"is",
"used",
"to",
"assert",
"that",
"a",
"path",
"is",
"printed",
".",
"On",
"Windows",
"it",
"uses",
"a",
"case",
"-",
"insensitive",
"match",
"and",
"escapes",
"the",
"path",
".",
"On",
"non",
"-",
"Windows",
"it",
"evaluates",
"the",
"b... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/integration/helpers/matchers.go#L19-L30 |
26,077 | cloudfoundry/cli | api/cloudcontroller/ccv2/buildpack.go | CreateBuildpack | func (client *Client) CreateBuildpack(buildpack Buildpack) (Buildpack, Warnings, error) {
body, err := json.Marshal(buildpack)
if err != nil {
return Buildpack{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostBuildpackRequest,
Body: bytes.NewReader(body),
... | go | func (client *Client) CreateBuildpack(buildpack Buildpack) (Buildpack, Warnings, error) {
body, err := json.Marshal(buildpack)
if err != nil {
return Buildpack{}, nil, err
}
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.PostBuildpackRequest,
Body: bytes.NewReader(body),
... | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateBuildpack",
"(",
"buildpack",
"Buildpack",
")",
"(",
"Buildpack",
",",
"Warnings",
",",
"error",
")",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"buildpack",
")",
"\n",
"if",
"err",
"!=... | // CreateBuildpack creates a new buildpack. | [
"CreateBuildpack",
"creates",
"a",
"new",
"buildpack",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/buildpack.go#L76-L97 |
26,078 | cloudfoundry/cli | api/cloudcontroller/ccv2/buildpack.go | GetBuildpacks | func (client *Client) GetBuildpacks(filters ...Filter) ([]Buildpack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetBuildpacksRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var buildpacks []Buildpack
warn... | go | func (client *Client) GetBuildpacks(filters ...Filter) ([]Buildpack, Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.GetBuildpacksRequest,
Query: ConvertFilterParameters(filters),
})
if err != nil {
return nil, nil, err
}
var buildpacks []Buildpack
warn... | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetBuildpacks",
"(",
"filters",
"...",
"Filter",
")",
"(",
"[",
"]",
"Buildpack",
",",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"requestOptions",
"{... | // GetBuildpacks searches for a buildpack with the given name and returns it if it exists. | [
"GetBuildpacks",
"searches",
"for",
"a",
"buildpack",
"with",
"the",
"given",
"name",
"and",
"returns",
"it",
"if",
"it",
"exists",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/buildpack.go#L100-L124 |
26,079 | cloudfoundry/cli | api/cloudcontroller/ccv2/buildpack.go | UploadBuildpack | func (client *Client) UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64) (Warnings, error) {
contentLength, err := buildpacks.CalculateRequestSize(buildpackLength, buildpackPath, "buildpack")
if err != nil {
return nil, err
}
contentType, body, writeErrors :=... | go | func (client *Client) UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64) (Warnings, error) {
contentLength, err := buildpacks.CalculateRequestSize(buildpackLength, buildpackPath, "buildpack")
if err != nil {
return nil, err
}
contentType, body, writeErrors :=... | [
"func",
"(",
"client",
"*",
"Client",
")",
"UploadBuildpack",
"(",
"buildpackGUID",
"string",
",",
"buildpackPath",
"string",
",",
"buildpack",
"io",
".",
"Reader",
",",
"buildpackLength",
"int64",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"contentLength",... | // UploadBuildpack uploads the contents of a buildpack zip to the server. | [
"UploadBuildpack",
"uploads",
"the",
"contents",
"of",
"a",
"buildpack",
"zip",
"to",
"the",
"server",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/buildpack.go#L158-L185 |
26,080 | cloudfoundry/cli | util/sorting/alphabetic.go | LessIgnoreCase | func LessIgnoreCase(first string, second string) bool {
iRunes := []rune(first)
jRunes := []rune(second)
max := len(iRunes)
if max > len(jRunes) {
max = len(jRunes)
}
for idx := 0; idx < max; idx++ {
ir := iRunes[idx]
jr := jRunes[idx]
lir := unicode.ToLower(ir)
ljr := unicode.ToLower(jr)
if lir =... | go | func LessIgnoreCase(first string, second string) bool {
iRunes := []rune(first)
jRunes := []rune(second)
max := len(iRunes)
if max > len(jRunes) {
max = len(jRunes)
}
for idx := 0; idx < max; idx++ {
ir := iRunes[idx]
jr := jRunes[idx]
lir := unicode.ToLower(ir)
ljr := unicode.ToLower(jr)
if lir =... | [
"func",
"LessIgnoreCase",
"(",
"first",
"string",
",",
"second",
"string",
")",
"bool",
"{",
"iRunes",
":=",
"[",
"]",
"rune",
"(",
"first",
")",
"\n",
"jRunes",
":=",
"[",
"]",
"rune",
"(",
"second",
")",
"\n\n",
"max",
":=",
"len",
"(",
"iRunes",
... | // LessIgnoreCase returns true if first is alphabetically less than second. | [
"LessIgnoreCase",
"returns",
"true",
"if",
"first",
"is",
"alphabetically",
"less",
"than",
"second",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/sorting/alphabetic.go#L10-L34 |
26,081 | cloudfoundry/cli | actor/v2action/security_group.go | GetSpaceRunningSecurityGroupsBySpace | func (actor Actor) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | go | func (actor Actor) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | [
"func",
"(",
"actor",
"Actor",
")",
"GetSpaceRunningSecurityGroupsBySpace",
"(",
"spaceGUID",
"string",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"ccv2SecurityGroups",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudC... | // GetSpaceRunningSecurityGroupsBySpace returns a list of all security groups
// bound to this space in the 'running' lifecycle phase. | [
"GetSpaceRunningSecurityGroupsBySpace",
"returns",
"a",
"list",
"of",
"all",
"security",
"groups",
"bound",
"to",
"this",
"space",
"in",
"the",
"running",
"lifecycle",
"phase",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/security_group.go#L236-L239 |
26,082 | cloudfoundry/cli | actor/v2action/security_group.go | GetSpaceStagingSecurityGroupsBySpace | func (actor Actor) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceStagingSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | go | func (actor Actor) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error) {
ccv2SecurityGroups, warnings, err := actor.CloudControllerClient.GetSpaceStagingSecurityGroups(spaceGUID)
return processSecurityGroups(spaceGUID, ccv2SecurityGroups, Warnings(warnings), err)
} | [
"func",
"(",
"actor",
"Actor",
")",
"GetSpaceStagingSecurityGroupsBySpace",
"(",
"spaceGUID",
"string",
")",
"(",
"[",
"]",
"SecurityGroup",
",",
"Warnings",
",",
"error",
")",
"{",
"ccv2SecurityGroups",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudC... | // GetSpaceStagingSecurityGroupsBySpace returns a list of all security groups
// bound to this space in the 'staging' lifecycle phase. with an optional | [
"GetSpaceStagingSecurityGroupsBySpace",
"returns",
"a",
"list",
"of",
"all",
"security",
"groups",
"bound",
"to",
"this",
"space",
"in",
"the",
"staging",
"lifecycle",
"phase",
".",
"with",
"an",
"optional"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/security_group.go#L243-L246 |
26,083 | cloudfoundry/cli | cf/util/downloader/file_download.go | DownloadFile | func (d *downloader) DownloadFile(url string) (int64, string, error) {
c := http.Client{
CheckRedirect: func(r *http.Request, via []*http.Request) error {
r.URL.Opaque = r.URL.Path
//some redirect return '/' as url
if strings.Trim(r.URL.Opaque, "/") != "" {
url = r.URL.Opaque
}
return nil
},
... | go | func (d *downloader) DownloadFile(url string) (int64, string, error) {
c := http.Client{
CheckRedirect: func(r *http.Request, via []*http.Request) error {
r.URL.Opaque = r.URL.Path
//some redirect return '/' as url
if strings.Trim(r.URL.Opaque, "/") != "" {
url = r.URL.Opaque
}
return nil
},
... | [
"func",
"(",
"d",
"*",
"downloader",
")",
"DownloadFile",
"(",
"url",
"string",
")",
"(",
"int64",
",",
"string",
",",
"error",
")",
"{",
"c",
":=",
"http",
".",
"Client",
"{",
"CheckRedirect",
":",
"func",
"(",
"r",
"*",
"http",
".",
"Request",
",... | //this func returns byte written, filename and error | [
"this",
"func",
"returns",
"byte",
"written",
"filename",
"and",
"error"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/util/downloader/file_download.go#L32-L76 |
26,084 | cloudfoundry/cli | api/cloudcontroller/ccv2/paginated_resources.go | Resources | func (pr PaginatedResources) Resources() ([]interface{}, error) {
slicePtr := reflect.New(reflect.SliceOf(pr.resourceType))
err := json.Unmarshal([]byte(pr.ResourcesBytes), slicePtr.Interface())
slice := reflect.Indirect(slicePtr)
contents := make([]interface{}, 0, slice.Len())
for i := 0; i < slice.Len(); i++ {
... | go | func (pr PaginatedResources) Resources() ([]interface{}, error) {
slicePtr := reflect.New(reflect.SliceOf(pr.resourceType))
err := json.Unmarshal([]byte(pr.ResourcesBytes), slicePtr.Interface())
slice := reflect.Indirect(slicePtr)
contents := make([]interface{}, 0, slice.Len())
for i := 0; i < slice.Len(); i++ {
... | [
"func",
"(",
"pr",
"PaginatedResources",
")",
"Resources",
"(",
")",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"slicePtr",
":=",
"reflect",
".",
"New",
"(",
"reflect",
".",
"SliceOf",
"(",
"pr",
".",
"resourceType",
")",
")",
"\n"... | // Resources unmarshals JSON representing a page of resources and returns a
// slice of the given resource type. | [
"Resources",
"unmarshals",
"JSON",
"representing",
"a",
"page",
"of",
"resources",
"and",
"returns",
"a",
"slice",
"of",
"the",
"given",
"resource",
"type",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/paginated_resources.go#L29-L39 |
26,085 | cloudfoundry/cli | actor/v2action/space.go | GetSpaceByOrganizationAndName | func (actor Actor) GetSpaceByOrganizationAndName(orgGUID string, spaceName string) (Space, Warnings, error) {
ccv2Spaces, warnings, err := actor.CloudControllerClient.GetSpaces(
ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{spaceName},
},
ccv2.Filter{
... | go | func (actor Actor) GetSpaceByOrganizationAndName(orgGUID string, spaceName string) (Space, Warnings, error) {
ccv2Spaces, warnings, err := actor.CloudControllerClient.GetSpaces(
ccv2.Filter{
Type: constant.NameFilter,
Operator: constant.EqualOperator,
Values: []string{spaceName},
},
ccv2.Filter{
... | [
"func",
"(",
"actor",
"Actor",
")",
"GetSpaceByOrganizationAndName",
"(",
"orgGUID",
"string",
",",
"spaceName",
"string",
")",
"(",
"Space",
",",
"Warnings",
",",
"error",
")",
"{",
"ccv2Spaces",
",",
"warnings",
",",
"err",
":=",
"actor",
".",
"CloudContro... | // GetSpaceByOrganizationAndName returns an Space based on the org and name. | [
"GetSpaceByOrganizationAndName",
"returns",
"an",
"Space",
"based",
"on",
"the",
"org",
"and",
"name",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space.go#L101-L127 |
26,086 | cloudfoundry/cli | actor/v2action/space.go | GrantSpaceManagerByUsername | func (actor Actor) GrantSpaceManagerByUsername(orgGUID string, spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
return actor.grantSpaceManagerByClientCredentials(orgGUID, spaceGUID, username)
}
return actor.grantSpaceManagerByUs... | go | func (actor Actor) GrantSpaceManagerByUsername(orgGUID string, spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
return actor.grantSpaceManagerByClientCredentials(orgGUID, spaceGUID, username)
}
return actor.grantSpaceManagerByUs... | [
"func",
"(",
"actor",
"Actor",
")",
"GrantSpaceManagerByUsername",
"(",
"orgGUID",
"string",
",",
"spaceGUID",
"string",
",",
"username",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"if",
"actor",
".",
"Config",
".",
"UAAGrantType",
"(",
")",
"... | // GrantSpaceManagerByUsername makes the provided user a Space Manager in the
// space with the provided guid. | [
"GrantSpaceManagerByUsername",
"makes",
"the",
"provided",
"user",
"a",
"Space",
"Manager",
"in",
"the",
"space",
"with",
"the",
"provided",
"guid",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space.go#L131-L137 |
26,087 | cloudfoundry/cli | actor/v2action/space.go | GrantSpaceDeveloperByUsername | func (actor Actor) GrantSpaceDeveloperByUsername(spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
warnings, err := actor.CloudControllerClient.UpdateSpaceDeveloper(spaceGUID, username)
return Warnings(warnings), err
}
warning... | go | func (actor Actor) GrantSpaceDeveloperByUsername(spaceGUID string, username string) (Warnings, error) {
if actor.Config.UAAGrantType() == string(uaaconst.GrantTypeClientCredentials) {
warnings, err := actor.CloudControllerClient.UpdateSpaceDeveloper(spaceGUID, username)
return Warnings(warnings), err
}
warning... | [
"func",
"(",
"actor",
"Actor",
")",
"GrantSpaceDeveloperByUsername",
"(",
"spaceGUID",
"string",
",",
"username",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"if",
"actor",
".",
"Config",
".",
"UAAGrantType",
"(",
")",
"==",
"string",
"(",
"uaa... | // GrantSpaceDeveloperByUsername makes the provided user a Space Developer in the
// space with the provided guid. | [
"GrantSpaceDeveloperByUsername",
"makes",
"the",
"provided",
"user",
"a",
"Space",
"Developer",
"in",
"the",
"space",
"with",
"the",
"provided",
"guid",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/space.go#L170-L179 |
26,088 | cloudfoundry/cli | actor/v2action/user.go | CreateUser | func (actor Actor) CreateUser(username string, password string, origin string) (User, Warnings, error) {
uaaUser, err := actor.UAAClient.CreateUser(username, password, origin)
if err != nil {
return User{}, nil, err
}
ccUser, ccWarnings, err := actor.CloudControllerClient.CreateUser(uaaUser.ID)
return User(ccU... | go | func (actor Actor) CreateUser(username string, password string, origin string) (User, Warnings, error) {
uaaUser, err := actor.UAAClient.CreateUser(username, password, origin)
if err != nil {
return User{}, nil, err
}
ccUser, ccWarnings, err := actor.CloudControllerClient.CreateUser(uaaUser.ID)
return User(ccU... | [
"func",
"(",
"actor",
"Actor",
")",
"CreateUser",
"(",
"username",
"string",
",",
"password",
"string",
",",
"origin",
"string",
")",
"(",
"User",
",",
"Warnings",
",",
"error",
")",
"{",
"uaaUser",
",",
"err",
":=",
"actor",
".",
"UAAClient",
".",
"Cr... | // CreateUser creates a new user in UAA and registers it with cloud controller. | [
"CreateUser",
"creates",
"a",
"new",
"user",
"in",
"UAA",
"and",
"registers",
"it",
"with",
"cloud",
"controller",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/user.go#L9-L18 |
26,089 | cloudfoundry/cli | command/v6/shared/new_networking_client.go | NewNetworkingClient | func NewNetworkingClient(apiURL string, config command.Config, uaaClient *uaa.Client, ui command.UI) (*cfnetv1.Client, error) {
if apiURL == "" {
return nil, translatableerror.CFNetworkingEndpointNotFoundError{}
}
wrappers := []cfnetv1.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
wr... | go | func NewNetworkingClient(apiURL string, config command.Config, uaaClient *uaa.Client, ui command.UI) (*cfnetv1.Client, error) {
if apiURL == "" {
return nil, translatableerror.CFNetworkingEndpointNotFoundError{}
}
wrappers := []cfnetv1.ConnectionWrapper{}
verbose, location := config.Verbose()
if verbose {
wr... | [
"func",
"NewNetworkingClient",
"(",
"apiURL",
"string",
",",
"config",
"command",
".",
"Config",
",",
"uaaClient",
"*",
"uaa",
".",
"Client",
",",
"ui",
"command",
".",
"UI",
")",
"(",
"*",
"cfnetv1",
".",
"Client",
",",
"error",
")",
"{",
"if",
"apiUR... | // NewNetworkingClient creates a new cfnetworking client. | [
"NewNetworkingClient",
"creates",
"a",
"new",
"cfnetworking",
"client",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/command/v6/shared/new_networking_client.go#L12-L40 |
26,090 | cloudfoundry/cli | actor/v2action/service_plan.go | GetServicePlansForService | func (actor Actor) GetServicePlansForService(serviceName, brokerName string) ([]ServicePlan, Warnings, error) {
service, allWarnings, err := actor.GetServiceByNameAndBrokerName(serviceName, brokerName)
if err != nil {
return []ServicePlan{}, allWarnings, err
}
servicePlans, warnings, err := actor.CloudController... | go | func (actor Actor) GetServicePlansForService(serviceName, brokerName string) ([]ServicePlan, Warnings, error) {
service, allWarnings, err := actor.GetServiceByNameAndBrokerName(serviceName, brokerName)
if err != nil {
return []ServicePlan{}, allWarnings, err
}
servicePlans, warnings, err := actor.CloudController... | [
"func",
"(",
"actor",
"Actor",
")",
"GetServicePlansForService",
"(",
"serviceName",
",",
"brokerName",
"string",
")",
"(",
"[",
"]",
"ServicePlan",
",",
"Warnings",
",",
"error",
")",
"{",
"service",
",",
"allWarnings",
",",
"err",
":=",
"actor",
".",
"Ge... | // GetServicePlansForService returns a list of plans associated with the service and the broker if provided | [
"GetServicePlansForService",
"returns",
"a",
"list",
"of",
"plans",
"associated",
"with",
"the",
"service",
"and",
"the",
"broker",
"if",
"provided"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v2action/service_plan.go#L17-L39 |
26,091 | cloudfoundry/cli | cf/terminal/table.go | NewTable | func NewTable(headers []string) *Table {
pt := &Table{
headers: headers,
columnWidth: make([]int, len(headers)),
colSpacing: " ",
transformer: make([]Transformer, len(headers)),
}
// Standard colorization, column 0 is auto-highlighted as some
// name. Everything else has no transformation (== identit... | go | func NewTable(headers []string) *Table {
pt := &Table{
headers: headers,
columnWidth: make([]int, len(headers)),
colSpacing: " ",
transformer: make([]Transformer, len(headers)),
}
// Standard colorization, column 0 is auto-highlighted as some
// name. Everything else has no transformation (== identit... | [
"func",
"NewTable",
"(",
"headers",
"[",
"]",
"string",
")",
"*",
"Table",
"{",
"pt",
":=",
"&",
"Table",
"{",
"headers",
":",
"headers",
",",
"columnWidth",
":",
"make",
"(",
"[",
"]",
"int",
",",
"len",
"(",
"headers",
")",
")",
",",
"colSpacing"... | // NewTable is the constructor function creating a new printable table
// from a list of headers. The table is also connected to a UI, which
// is where it will print itself to on demand. | [
"NewTable",
"is",
"the",
"constructor",
"function",
"creating",
"a",
"new",
"printable",
"table",
"from",
"a",
"list",
"of",
"headers",
".",
"The",
"table",
"is",
"also",
"connected",
"to",
"a",
"UI",
"which",
"is",
"where",
"it",
"will",
"print",
"itself"... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L32-L49 |
26,092 | cloudfoundry/cli | cf/terminal/table.go | SetTransformer | func (t *Table) SetTransformer(columnIndex int, tr Transformer) {
t.transformer[columnIndex] = tr
} | go | func (t *Table) SetTransformer(columnIndex int, tr Transformer) {
t.transformer[columnIndex] = tr
} | [
"func",
"(",
"t",
"*",
"Table",
")",
"SetTransformer",
"(",
"columnIndex",
"int",
",",
"tr",
"Transformer",
")",
"{",
"t",
".",
"transformer",
"[",
"columnIndex",
"]",
"=",
"tr",
"\n",
"}"
] | // SetTransformer specifies a string transformer to apply to the
// content of the given column in the specified table. | [
"SetTransformer",
"specifies",
"a",
"string",
"transformer",
"to",
"apply",
"to",
"the",
"content",
"of",
"the",
"given",
"column",
"in",
"the",
"specified",
"table",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L61-L63 |
26,093 | cloudfoundry/cli | cf/terminal/table.go | Add | func (t *Table) Add(row ...string) {
t.rows = append(t.rows, row)
} | go | func (t *Table) Add(row ...string) {
t.rows = append(t.rows, row)
} | [
"func",
"(",
"t",
"*",
"Table",
")",
"Add",
"(",
"row",
"...",
"string",
")",
"{",
"t",
".",
"rows",
"=",
"append",
"(",
"t",
".",
"rows",
",",
"row",
")",
"\n",
"}"
] | // Add extends the table by another row. | [
"Add",
"extends",
"the",
"table",
"by",
"another",
"row",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L66-L68 |
26,094 | cloudfoundry/cli | cf/terminal/table.go | printRow | func (t *Table) printRow(result io.Writer, transformer rowTransformer, rowIndex int, row []string) error {
height := t.rowHeight[rowIndex]
// Compute the index of the last column as the min number of
// cells in the header and cells in the current row.
// Note: math.Min seems to be for float only :(
last := len(... | go | func (t *Table) printRow(result io.Writer, transformer rowTransformer, rowIndex int, row []string) error {
height := t.rowHeight[rowIndex]
// Compute the index of the last column as the min number of
// cells in the header and cells in the current row.
// Note: math.Min seems to be for float only :(
last := len(... | [
"func",
"(",
"t",
"*",
"Table",
")",
"printRow",
"(",
"result",
"io",
".",
"Writer",
",",
"transformer",
"rowTransformer",
",",
"rowIndex",
"int",
",",
"row",
"[",
"]",
"string",
")",
"error",
"{",
"height",
":=",
"t",
".",
"rowHeight",
"[",
"rowIndex"... | // printRow is responsible for the layouting, transforming and
// printing of the string in a single row | [
"printRow",
"is",
"responsible",
"for",
"the",
"layouting",
"transforming",
"and",
"printing",
"of",
"the",
"string",
"in",
"a",
"single",
"row"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L179-L255 |
26,095 | cloudfoundry/cli | cf/terminal/table.go | printCellValue | func (t *Table) printCellValue(result io.Writer, transformer rowTransformer, col, last int, value string) error {
value = trim(transformer.Transform(col, trim(value)))
fmt.Fprint(result, value)
// Pad all columns, but the last in this row (with the size of
// the header row limiting this). This ensures that most o... | go | func (t *Table) printCellValue(result io.Writer, transformer rowTransformer, col, last int, value string) error {
value = trim(transformer.Transform(col, trim(value)))
fmt.Fprint(result, value)
// Pad all columns, but the last in this row (with the size of
// the header row limiting this). This ensures that most o... | [
"func",
"(",
"t",
"*",
"Table",
")",
"printCellValue",
"(",
"result",
"io",
".",
"Writer",
",",
"transformer",
"rowTransformer",
",",
"col",
",",
"last",
"int",
",",
"value",
"string",
")",
"error",
"{",
"value",
"=",
"trim",
"(",
"transformer",
".",
"... | // printCellValue pads the specified string to the width of the given
// column, adds the spacing bewtween columns, and returns the result. | [
"printCellValue",
"pads",
"the",
"specified",
"string",
"to",
"the",
"width",
"of",
"the",
"given",
"column",
"adds",
"the",
"spacing",
"bewtween",
"columns",
"and",
"returns",
"the",
"result",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L259-L300 |
26,096 | cloudfoundry/cli | cf/terminal/table.go | Transform | func (th *transformHeader) Transform(column int, s string) string {
return HeaderColor(s)
} | go | func (th *transformHeader) Transform(column int, s string) string {
return HeaderColor(s)
} | [
"func",
"(",
"th",
"*",
"transformHeader",
")",
"Transform",
"(",
"column",
"int",
",",
"s",
"string",
")",
"string",
"{",
"return",
"HeaderColor",
"(",
"s",
")",
"\n",
"}"
] | // Transform performs the Header highlighting for transformHeader | [
"Transform",
"performs",
"the",
"Header",
"highlighting",
"for",
"transformHeader"
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L318-L320 |
26,097 | cloudfoundry/cli | cf/terminal/table.go | visibleSize | func visibleSize(s string) (int, error) {
// This code re-implements the basic functionality of
// RuneCountInString to account for special cases. Namely
// UTF-8 characters taking up 3 bytes (**) appear as double-width.
//
// (**) I wonder if that is the set of characters outside of
// the BMP <=> the set of cha... | go | func visibleSize(s string) (int, error) {
// This code re-implements the basic functionality of
// RuneCountInString to account for special cases. Namely
// UTF-8 characters taking up 3 bytes (**) appear as double-width.
//
// (**) I wonder if that is the set of characters outside of
// the BMP <=> the set of cha... | [
"func",
"visibleSize",
"(",
"s",
"string",
")",
"(",
"int",
",",
"error",
")",
"{",
"// This code re-implements the basic functionality of",
"// RuneCountInString to account for special cases. Namely",
"// UTF-8 characters taking up 3 bytes (**) appear as double-width.",
"//",
"// (*... | // visibleSize returns the number of columns the string will cover
// when displayed in the terminal. This is the number of runes,
// i.e. characters, not the number of bytes it consists of. | [
"visibleSize",
"returns",
"the",
"number",
"of",
"columns",
"the",
"string",
"will",
"cover",
"when",
"displayed",
"in",
"the",
"terminal",
".",
"This",
"is",
"the",
"number",
"of",
"runes",
"i",
".",
"e",
".",
"characters",
"not",
"the",
"number",
"of",
... | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/cf/terminal/table.go#L344-L370 |
26,098 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | DeleteIsolationSegmentOrganization | func (client *Client) DeleteIsolationSegmentOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteIsolationSegmentRelationshipOrganizationRequest,
URIParams: internal.Params{"isolation_segment_guid": isolati... | go | func (client *Client) DeleteIsolationSegmentOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteIsolationSegmentRelationshipOrganizationRequest,
URIParams: internal.Params{"isolation_segment_guid": isolati... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteIsolationSegmentOrganization",
"(",
"isolationSegmentGUID",
"string",
",",
"orgGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest",
"(",
"... | // DeleteIsolationSegmentOrganization will delete the relationship between
// the isolation segment and the organization provided. | [
"DeleteIsolationSegmentOrganization",
"will",
"delete",
"the",
"relationship",
"between",
"the",
"isolation",
"segment",
"and",
"the",
"organization",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L53-L66 |
26,099 | cloudfoundry/cli | api/cloudcontroller/ccv3/relationship.go | DeleteServiceInstanceRelationshipsSharedSpace | func (client *Client) DeleteServiceInstanceRelationshipsSharedSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteServiceInstanceRelationshipsSharedSpaceRequest,
URIParams: internal.Params{"service_instance_guid... | go | func (client *Client) DeleteServiceInstanceRelationshipsSharedSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error) {
request, err := client.newHTTPRequest(requestOptions{
RequestName: internal.DeleteServiceInstanceRelationshipsSharedSpaceRequest,
URIParams: internal.Params{"service_instance_guid... | [
"func",
"(",
"client",
"*",
"Client",
")",
"DeleteServiceInstanceRelationshipsSharedSpace",
"(",
"serviceInstanceGUID",
"string",
",",
"spaceGUID",
"string",
")",
"(",
"Warnings",
",",
"error",
")",
"{",
"request",
",",
"err",
":=",
"client",
".",
"newHTTPRequest"... | // DeleteServiceInstanceRelationshipsSharedSpace will delete the sharing relationship
// between the service instance and the shared-to space provided. | [
"DeleteServiceInstanceRelationshipsSharedSpace",
"will",
"delete",
"the",
"sharing",
"relationship",
"between",
"the",
"service",
"instance",
"and",
"the",
"shared",
"-",
"to",
"space",
"provided",
"."
] | 5010c000047f246b870475e2c299556078cdad30 | https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv3/relationship.go#L70-L82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.