MCPcopy Create free account
hub / github.com/cloudfoundry/cli / bytesVal

Function bytesVal

cf/manifest/manifest.go:308–326  ·  view source on GitHub ↗
(yamlMap generic.Map, key string, errs *[]error)

Source from the content-addressed store, hash-verified

306}
307
308func bytesVal(yamlMap generic.Map, key string, errs *[]error) *int64 {
309 yamlVal := yamlMap.Get(key)
310 if yamlVal == nil {
311 return nil
312 }
313
314 stringVal := coerceToString(yamlVal)
315 value, err := formatters.ToMegabytes(stringVal)
316 if err != nil {
317 *errs = append(*errs, errors.New(T("Invalid value for '{{.PropertyName}}': {{.StringVal}}\n{{.Error}}",
318 map[string]interface{}{
319 "PropertyName": key,
320 "Error": err.Error(),
321 "StringVal": stringVal,
322 })))
323 return nil
324 }
325 return &value
326}
327
328func intVal(yamlMap generic.Map, key string, errs *[]error) *int {
329 var (

Callers 1

mapToAppParamsFunction · 0.85

Calls 4

ToMegabytesFunction · 0.92
coerceToStringFunction · 0.85
GetMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected