toolbox

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Package toolbox contains various nice-to-have functions and types such as log setup, formatting and so on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvVarResolver

func EnvVarResolver() kong.ResolverFunc

EnvVarResolver is an environment variable resolver for Kong -- ie it will default to the environment variable for the parameters. The parameters are named similarly to the parameter names but in upper case and with underscores. ie "--some-parameter-name" will use the environment variable "SOME_PARAMETER_NAME"

func GetSignalChannel

func GetSignalChannel() chan os.Signal

GetSignalChannel returns the signal channel. This is for testing.

func SendInterrupt

func SendInterrupt()

SendInterrupt sends an interrupt signal to the waiting channel

func StringByteSize

func StringByteSize(size int64) string

StringByteSize converts a size (in bytes) to bytes, kibibytes (KiB), mebibyte (MiB), gibibyte (GiB), tebibyte (TiB), pebibyte (PiB) or exbibyte (EiB) The returned string includes the unit (nnn bytes, n.nn KiB, n.nn MiB, ...)

func WaitForSignal

func WaitForSignal()

WaitForSignal waits for a signal to terminate

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL