MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / makeDefaultHeader

Function makeDefaultHeader

commands/util.go:262–273  ·  view source on GitHub ↗

makeDefaultHeader(collection) returns the default header to be used in case the list to be printed is empty.

(collection interface{})

Source from the content-addressed store, hash-verified

260// makeDefaultHeader(collection) returns the default header to be used in case
261// the list to be printed is empty.
262func makeDefaultHeader(collection interface{}) string {
263 defaultHeader := reflect.TypeOf(collection).String()
264 defaultHeader = strings.ToLower(defaultHeader[8:] + "s") // Removes '[]whisk.' from `[]whisk.ENTITY_TYPE`
265 if defaultHeader == "apifilteredrows" {
266 defaultHeader = fmt.Sprintf("%-30s %7s %20s %s", "Action", "Verb", "API Name", "URL")
267 } else if defaultHeader == "apifilteredlists" {
268 defaultHeader = ""
269 } else if defaultHeader == "activationfilteredrows" {
270 defaultHeader = ""
271 }
272 return defaultHeader
273}
274
275func stripTimestamp(log string) (strippedLog string) {
276 // parses out the timestamp if it exists first

Callers 1

printListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected