Documentation
¶
Index ¶
- Variables
- func BannerLog(log logr.Logger, name, version, buildTime string)
- func BannerStdout(name, version, buildTime string)
- func BannerStdoutLong(name, version, buildTime string)
- func ChannelWrapper(fn func() error) <-chan error
- func DisableGoLog()
- func GetExeDir(log logr.Logger) string
- func GetLogger(devMode bool, options ...int) logr.Logger
- func HomePath(path string) string
- func InstallSignalHandlers(log logr.Logger) <-chan struct{}
- func InterceptGoLog(l logr.Logger)
- func MaxInt[T constraints.Integer](x, y T) T
- func MinInt[T constraints.Integer](x, y T) T
- func PrintUpdateLn(s string)
- func SetLevel(l int)
- func Ternary[T any](test bool, yes, no T) T
Constants ¶
This section is empty.
Variables ¶
var ( // Global is a globally-scoped logger than can be used if you have no other choice Global logr.Logger )
Functions ¶
func BannerLog ¶ added in v0.0.4
BannerLog logs a few pieces of information about the programme; name, version, build time
func BannerStdout ¶ added in v0.0.4
func BannerStdout(name, version, buildTime string)
BannerStdout prints a short banner showing the programme name and version
func BannerStdoutLong ¶ added in v0.0.4
func BannerStdoutLong(name, version, buildTime string)
BannerStdoutLong prints a long banner detailing things about the programme's build and runtime environment
func ChannelWrapper ¶
ChannelWrapper runs an error-returning func on a background goroutine. If the func returns an error, that is sent down the channel that's returned.
func DisableGoLog ¶ added in v0.0.7
func DisableGoLog()
func GetExeDir ¶ added in v0.0.4
GetExeDir returns the directory in which the running binary is located
func HomePath ¶ added in v0.0.4
HomePath returns the absolute path to a given name in the current user's home directory
func InstallSignalHandlers ¶
InstallSignalHandlers registers handlers for common OS signals, and closes the returned channel if they're received.
func InterceptGoLog ¶ added in v0.0.7
func MaxInt ¶ added in v0.0.6
func MaxInt[T constraints.Integer](x, y T) T
MaxInt returns the minimum value of two ints. Use math.Max for floats
func MinInt ¶ added in v0.0.6
func MinInt[T constraints.Integer](x, y T) T
MinInt returns the minimum value of two ints. Use math.Min for floats
func PrintUpdateLn ¶ added in v0.0.2
func PrintUpdateLn(s string)
PrintUpdateLn prints s to stdout. If stdout is connected to a terminal, it leaves the cursor at the end of the line and overwrites that line with any subsequent messages If stdout is not connected to a terminal, message are printed with newlines, just like fmt.Println() s should not contain any newline or other escape characters Calls to PrintUpdateLn should not be mixed with anything else that interacts with stdout
Types ¶
This section is empty.