util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(bytes []byte) string

This casting *does not* copy data. Note that casting via "string(bytes)" *does* copy data.

func ConfigureLogging

func ConfigureLogging(verbosity int, path *string)

func CopySSH

func CopySSH(host string, username string, key string, reader io.Reader, targetPath string, permissions *int64) error

func ExecSSH

func ExecSSH(host string, username string, key string, stdin io.Reader, command ...string) (string, error)

func Fail

func Fail(message string)

func FailOnError

func FailOnError(err error)

func Failf

func Failf(f string, args ...interface{})

func GetFileHash

func GetFileHash(path string) (string, error)

func GetLock

func GetLock(pointer interface{}) *sync.RWMutex

func LogStack

func LogStack(log *logging.Logger, message string, skip int)

func ReaderSize

func ReaderSize(reader io.Reader) (int64, error)

func ResetLocks

func ResetLocks()

func SanitizeFilename

func SanitizeFilename(name string) string

func SetFlagsFromEnvironment

func SetFlagsFromEnvironment(prefix string)

func SetupSignalHandler

func SetupSignalHandler() <-chan struct{}

SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.

func SortedMapStringStringKeys

func SortedMapStringStringKeys(map_ map[string]string) []string

func StringToBytes

func StringToBytes(string_ string) (bytes []byte)

func Timestamp

func Timestamp(asString bool) interface{}

Types

type TarEncoder

type TarEncoder struct {
	// contains filtered or unexported fields
}

func NewTarEncoder

func NewTarEncoder(reader io.Reader, name string, size int64) *TarEncoder

func (*TarEncoder) Drain

func (self *TarEncoder) Drain()

func (*TarEncoder) Encode

func (self *TarEncoder) Encode() io.Reader

Jump to

Keyboard shortcuts

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