utils

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesEq added in v0.2.0

func BytesEq(x, y []byte) bool

func ExitErr

func ExitErr(err error)

func Immpossible added in v0.2.3

func Immpossible()

func InstallStallDetector added in v0.2.2

func InstallStallDetector(name string) *stallDetector

func ListNvidiaGPUNames

func ListNvidiaGPUNames() []string

func LogAllEnvs

func LogAllEnvs()

func LogArgs

func LogArgs()

func LogCudaEnv

func LogCudaEnv()

func LogEnvWithPrefix

func LogEnvWithPrefix(prefix string, logPrefix string)

func LogKungfuEnv

func LogKungfuEnv()

func LogNCCLEnv

func LogNCCLEnv()

func LogNICInfo

func LogNICInfo() error

func Measure

func Measure(f func() error) (time.Duration, error)

func MergeErrors added in v0.2.2

func MergeErrors(errs []error, hint string) error

func OpenURL added in v0.2.3

func OpenURL(url string, client *http.Client, userAgent string) (io.ReadCloser, error)

OpenURL opens a file or URL as io.ReadCloser.

func Pluralize

func Pluralize(n int, singular, plural string) string

func Poll added in v0.2.3

func Poll(ctx context.Context, cond func() bool) (int, bool)

Poll waits for a condition to become true

func ProgName

func ProgName() string

func Rate

func Rate(n int64, d time.Duration) float64

func ReadJSON added in v0.2.3

func ReadJSON(r io.Reader, i interface{}) error

func ShowBuildInfo added in v0.2.2

func ShowBuildInfo()

func ShowRate

func ShowRate(r float64) string

func Trap added in v0.2.2

func Trap(cancel func(os.Signal))

Types

This section is empty.

Directories

Path Synopsis
runner
from: https://github.com/lgarithm/go/blob/master/net/ssh/ssh.go Package ssh is a simple wrapper for golang.org/x/crypto/ssh
from: https://github.com/lgarithm/go/blob/master/net/ssh/ssh.go Package ssh is a simple wrapper for golang.org/x/crypto/ssh

Jump to

Keyboard shortcuts

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