Documentation ΒΆ
Overview ΒΆ
message from the author:
+--------------------------------------------------------------+ | * * * ββββββββββββββββββββ Hello ββββββββββββββββββββββββββ| +--------------------------------------------------------------+ | | | ++ ______________________________________ | | ++++ / \ | | ++++ | | | | ++++++++++ | Feel free to contribute to this | | | +++ | | project or contact me on | | | ++ | | manfred.life if you like this | | | + -== ==| | project! | | | ( <*> <*> | | | | | | /| :) | | | | _) / | | | | | +++ / \______________________________________/ | | \ =+ / | | \ + | | |\++++++ | | | ++++ ||// | | ___| |___ _||/__ __| | / --- \ \| ||| __ _ ___ __ __/ /| |/ | | \ \ / / ' \/ _ \/ // / / | || | | | | | /_/_/_/\___/\_,_/_/ | +--------------------------------------------------------------+
Index ΒΆ
Constants ΒΆ
This section is empty.
Variables ΒΆ
View Source
var AvailablePatterns = map[string]string{
`{{.LineNumber}}`: `display line number`,
`{{.LineNumber3}}`: `alias for {{printf "%-3d" .LineNumber}}`,
`{{.LineNumber4}}`: `alias for {{printf "%-4d" .LineNumber}}`,
`{{.LineNumber5}}`: `alias for {{printf "%-5d" .LineNumber}}`,
`{{.Format}}`: `the value you set with -format`,
`{{.Uptime}}`: `time since the the prefixer was initialized`,
`{{.Duration}}`: `time since previous line was started`,
`{{.Uptime | short_duration}}`: `{{.Uptime}} displayed in a pretty & short format (len<=7)`,
`{{.Duration | short_duration}}`: `{{.Duration}} displayed in a pretty & short format (len<=7)`,
`{{now}}`: `current date (format: 2006-01-02 15:04:05.999999999 -0700 MST)`,
`{{now | unixEpoch}}`: `current timestamp`,
`{{uuidv4}}`: `UUID of the v4 (randomly generated) type`,
`{{env "USER"}}`: `replace with content of the $USER env var`,
`{{.ShortDuration}}`: `alias for {{.Duration | short_duration}}`,
`{{.ShortUptime}}`: `alias for {{.Uptime | short_duration}}`,
}
AvailablePatterns is the list of available patterns to be used by the user.
This variable is only used to generate usage.
View Source
var AvailablePresets = map[string]string{
"{{DEFAULT}}": `{{.LineNumber3}} up={{.ShortUptime}} d={{.ShortDuration}} |`,
"{{SLOW_LINES}}": `{{if (gt .Duration 1000000000)}}SLOW{{else}} {{end}} {{.Duration | short_duration}} `,
"{{SHORT_DATE}}": `{{now | date "06/02/01 15:04:05"}}`,
}
AvailablePresets is the list of available presets.
Those presets are automatically replaced during the initialization of the prefixer.
Functions ΒΆ
This section is empty.
Types ΒΆ
type LinePrefixer ΒΆ
Click to show internal directories.
Click to hide internal directories.