utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReallyCrash bool

ReallyCrash For testing, bypass HandleCrash.

Functions

func ByteSize

func ByteSize(bytes uint64) string

ByteSize returns a human readable byte string, of the format 10M, 12.5K, etc. The following units are available:

T Terabyte
G Gigabyte
M Megabyte
K Kilobyte

the unit that would result in printing the smallest whole number is always chosen

func CopyFile added in v0.2.1

func CopyFile(src, dst string) error

func GenID

func GenID(btss ...[]byte) string

GenID generates an ID for given paylaod

func HandleCrash

func HandleCrash()

HandleCrash simply catches a crash and logs an error. Meant to be called via defer.

func LogTraceback

func LogTraceback(r interface{}, depth int, logger interface {
	Infof(fmt string, arg ...interface{})
})

LogTraceback prints traceback to given logger

func NewScanner

func NewScanner(r io.Reader) *bufio.Scanner

NewScanner returns a command line scanner

Types

This section is empty.

Directories

Path Synopsis
pflagenv
Package flagenv provides the ability to populate flags from environment variables.
Package flagenv provides the ability to populate flags from environment variables.
k8sutil is utilites to operate the k8s clusters
k8sutil is utilites to operate the k8s clusters

Jump to

Keyboard shortcuts

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