MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / reportName

Function reportName

internal/cmd/plugin/report/output.go:41–55  ·  view source on GitHub ↗

reportName returns a filesystem-safe, timestamped report name. Format: report_ [_ ]_YYYYMMDD_hhmmss

(kind string, timestamp time.Time, objName ...string)

Source from the content-addressed store, hash-verified

39// reportName returns a filesystem-safe, timestamped report name.
40// Format: report_<kind>[_<object>]_YYYYMMDD_hhmmss
41func reportName(kind string, timestamp time.Time, objName ...string) string {
42 var builder strings.Builder
43 builder.WriteString("report_")
44 builder.WriteString(kind)
45
46 if len(objName) != 0 {
47 builder.WriteString("_")
48 builder.WriteString(objName[0])
49 }
50
51 builder.WriteString("_")
52 builder.WriteString(timestamp.Format(sortableTimestampFormat))
53
54 return builder.String()
55}
56
57// zipFileWriter abstracts any function that will write a new file into a ZIP
58// within the `dirname` folder in the ZIP

Callers 4

operatorCmdFunction · 0.85
clusterFunction · 0.85
operatorFunction · 0.85
clusterCmdFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected